#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
	while(cin)
	{
		lld a,b;
		cin >> a >> b;
		lld n = min(a,b);
		lld m = max(a,b);
		lld gcd = 1;
		for(int i = 1; i <= n; i++)
		{
			if (n % i == 0 && m % i == 0)
			{
				gcd = i;
			}
		}
		cout << gcd << endl;
		cout << n * m / gcd << endl;
	}


	return 0;
}