
int main(){
	int a,b;
	int gcd,lcm,hoge;
	while(cin >> a >> b){
		if (a > b) {
			hoge = a;
			a = b;
			b = hoge;
		}
		for (int i=1;i < a;i++){
			if (a%i==0 && b%i==0){
				gcd = i;
			}
		}
		for (int j=a;1;j++){
			if (j%a==0 && j%b==0){
				lcm = j;
				break;
			}
		}
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}