#include<iostream>
#include<cmath>
#include<math.h>
using namespace std;
int main()
{
	
	long a,b,c,m,n,y,x;
	cin>>a>>b;
	m=a;
	n=b;
	c=b%a;
	x=a*b;
	while(c!=0){
		b=a;
		a=c;
		c=b%a;
	}
	
	x=m/a;
	y=n/a;
	cout<<x<<" "<<y;
	
	
	return 0;
}
