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