#include <iostream>
#include <algorithm>
using namespace std;

int A[60],B[60];

int gcd(int x,int y){
	if(y==0) return x;
	else return gcd(y,x%y);
}

int main(){
	int N;
	for(int i=1;i<=50;i++){
		cin>>A[i]>>B[i];
		if(cin.eof()){
			N=i-1;
			break;
		}
	}
	int res[2];
	for(int i=1;i<=N;i++){
		res[0]=gcd(A[i],B[i]);
		res[1]=A[i]/res[0]*B[i];
		cout<<res[0]<<" "<<res[1]<<endl;
	}
	return 0;
}