#include <iostream>
using namespace std;
int main(){
	long long a,b;
	
	while(cin>>a>>b){
		int r = a%b;
		long long lcm = a*b;
		while(r != 0){
			a = b;
			b = (long)r;
			r = a%b;
					
		}
		lcm /= b;
		cout<<b<<" "<<lcm<<endl;
	}
	return 0;
}