#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

long long gcd(int a,int b)
{
	if(a==0) return b;
	return (long long)gcd(b%a,a);
}

long long lcm(int a,int b)
{
	return (long long)a*b/gcd(a,b);
}

int main()
{
	int a,b;
	while(~scanf("%d%d",&a,&b))
	{
		cout<<gcd(a,b)<<' '<<lcm(a,b)<<endl;
	}

	return 0;
}