#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const int INF = 0x3fffffff;

int x, y;

int gcd(int x, int y) { if(!y) return x; else return gcd(y, x%y); }

int main()
{
	while(scanf("%d%d",&x,&y) != EOF)
	{
		int ans = gcd(x, y);
		cout<<ans<<" "<<(ll)x*y/ans<<endl;
	}
	return 0;
}