#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<vector>
#include<queue>
//aoj 0005
using namespace std;
int x,y;
int gcd(int a,int b)
{
	if(b==0)
	{
		return a;
	}else{
		return gcd(b,a%b);
	}
}
int lcm(int a,int b)
{
	return (long long)a*b/gcd(a,b);
}
int main()
{
	while(scanf("%d%d",&x,&y)!=EOF)
	{
		printf("%d %d\n",gcd(x,y),lcm(x,y));
	}
	return 0;
}








