#include<iostream>
using namespace std;
long long int gcd(long long int a, long long int b)// greatest common divisor 
{
	if (b == 0) {
		return a; 
	}
	return gcd(b, a%b);
}

long long int lcm(long long int a, long long int b)// least common multiple
{
	return a * b / gcd(a, b);
}

int main() {
	long long int a, b;
	while (cin>>a>>b) {
		cout << gcd(a, b) << ' ' << lcm(a, b)<<'\n';
	}
	return 0;
}