#include<iostream>
using namespace std;

unsigned long long int GCD();

int main(void){
	while(1){
		unsigned long long int a, b, gcd, lcm, temp;
		if( a < b){
			temp = a;
			a = b;
			b = temp;
		}
		cin >> a >> b;
		if(a == 0 || b == 0)
			return 0;
		gcd = GCD(a,b);
		lcm = a * b / gcd;
		cout << gcd << ' ' << lcm << endl;
	}
	return 0;
}

unsigned long long int GCD(unsinged long long int a, b){
	if(a % b == 0)
		return (b);
	else
		return (GCD(b, a%b);
}