#include<iostream>
#include<cmath>
#include<math.h>
using namespace std;

int main()
{
	int a,b,c,m,t,x;
	cin>>a>>b;
	
	if(a<b){
		t=a;
		a=b;
		b=t;
	}
	m=a*b;
	c=a%b;
	while(c!=0){
		a=b;
		b=c;
		c=a%b;
	}
	
	x=m/b;
	cout<<b<<" "<<x;
	return 0;
	
}
