#include<iostream>
using namespace std;
int gcd(int a, int b){
	int t;
	if(a < b){t=a;a=b;b=t;}
	t = b;
	b = a % b;
	a = t;
	if(b == 0){
		return a;
	}else{
		gcd(a,b);
	}
}
int lcm(double a, double b){
	return (a * b) / (gcd(a,b));
}
int main(){
	int a,b;
	while(cin >> a >> b)
	cout << gcd(a,b) << ' ' << lcm(a,b) << '\n';
	return 0;
}