#include<iostream>
#include<cstdio>
#include<utility>
#include<queue>
#include<stack>
using namespace std;
const int M=10000000000;
int gcd(int x,int y);
int Lcm(int x,int y,int z);
int main()
{
	int n,m;
	while(scanf("%d %d",&m,&n)!=EOF)
	{
		int a=gcd(m,n);
		int b=Lcm(m,n,a);
		printf("%d %d\n",a,b);
	}
	return 0;
}
int gcd(int x,int y)
{
	if(y==0)
	{
		return x;
	}
	else 
	{
		return gcd(y,x%y);
	}
}
int Lcm(int x,int y,int z)
{
	return x*y/z;
}
