#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repd(i,a,b) for (int i = (a); i < (b); i++)
typedef long long ll;

ll gcd(ll a, ll b)
{
	return b != 0 ? gcd(b, a%b): a;
}

int main(void)
{
	ll a, b, g, l;
	while (cin >> a >> b)
	{
	    g = gcd(a, b);
	    l = a*b / g;
	    cout << g << " " << l << endl;
	}
}
