#include<iostream>
#include<math.h>
#include<cstdio>
using namespace std;
int main(){
	while(1){
		long long a,b;
		cin>>a>>b;
		long long c=a*b;
		long temp;
		if(a<b){temp=a;a=b;b=temp;}
		if(cin.eof()) {break;}
		long q,r;
		while(a%b!=0){
			q=(long long)a/b;		
			r=(long long)a%b;
			a=b;
			b=r;
		}
		cout<<b<<" "<<c/b<<endl;		
	}
	return 0;	
}