#include<iostream>
#include<cstdlib>
#include<algorithm>

using namespace std;

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

int main(){
	long long a, b;
	while (scanf("%lld%lld", &a, &b) != EOF)
	{
		int d = gcd(a, b);
		int  lcm = a /d *b;
		cout << d << ' ' << lcm << endl;
	}
}