#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
#define lson l, m, rt<<1
#define rson m+1, r, rt<<1|1
#define IO ios::sync_with_stdio(false);cin.tie(0);
#define INF 0x3f3f3f3f
typedef long long ll;
using namespace std;
ll a, b;
ll gcd(ll a, ll b)
{
	if(b == 0) return a;
	return gcd(b, a%b);
}
int main()
{
	while(cin >> a >> b)
		cout << gcd(a, b) << " " << a/gcd(a, b)*b << endl;
	return 0;
}
