#include<iostream>
#include<algorithm>
using namespace std;
int gcd(int m ,int n){
	while(n!=0){
		int r=m%n;
		m=n;
		n=r;
	}
	return m;
}

int main(){
         int a ,b ,g ,l;
		 while(cin >> a >> b){
			g = gcd(a,b);
			l = a/g*b;
			cout << g <<" " << l << endl;
		 }
		 return 0;
}