#include <iostream>
#define U unsigned
#define L long
using namespace std;

U L gcd(U L L a,U L L b){
	if (a*b==0) return (a==0?b:a);
	else if (b%a==0) return a;
	else return gcd(b,a%b);
}

int main(){
	U L L x,y,g;
	while(cin>>x>>y){
		g=gcd(x,y); cout<<g<<" "<<(x/g)*y<<"\n";
	}
	return 0;
}