#include <iostream>
using namespace std;

int gcd(int a, int b);
int lcm(int a, int b);

int main(){
	int a, b, c, d;

	while(cin >> a >> b){
		c=gcd(a, b);
		d=lcm(a, b);

		cout << a << " " << b << endl;
	}

	return 0;
}

int gcd(int a, int b){
	int d, e, f;

	if(a>=b){ d=a; e=b; }
	else { d=b; e=a; }
	f=e;
	while(1){
		if(d%f==0) return f;
		f=d % e;
		d=e;
		e=f;
	}
}

int lcm(int a, int b){
	int c=gcd(a,b);
	int d;
	d=a;
	d /= c;
	d *= b;
	return d;
}