#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
using namespace std;

int main()
{
	int a,b;
	while(scanf("%d %d",&a,&b))
	{int gcd=0;
	int lcf=0;
	for(int i=2;i<=min(a,b);i++)
		if(a%i==0&&b%i==0)gcd=i;
	for(int i=b;i>1;i--)
		if(a*i%b==0)lcf=a*i;
	cout<<gcd<<" "<<lcf<<endl;
	}
}