//#include<cstdio>
#include<iostream>
using namespace std;

int main(){
	long long a, b, t, gcd, lcm;
	while( cin >> a >> b ){
		t=a*b;
		while(a!=b){
			while(a>b) a-=b;
			while(a<b) b-=a;
		}
		gcd=a;
		lcm=t/gcd;
		cout << gcd << " " << lcm << endl;
	}
 return 0;
}