#include<iostream>
using namespace std;

int main()
{
	long long a,b,m,n,d,i,k;
	int c=2;
	while(c--)
	{cin>>a>>b;
		if(a>b)
		{
			d=a;
			a=b;
			b=d;
		}
		for(i=a;i>1;i--)
		{
			if((b%i)==0&&(a%i)==0)
			break;
		}
		n=i;
		k=(a*b)/n;
		m=k;
		cout<<n<<" "<<m;
		cout<<endl;
	}
	return 0;
 } 