//AOJ0005
#include<iostream>
using namespace std;

int gcd(int n,int m){
	if(m==0)return n;
	gcd(m,n%m);
}
int main(){
	int n,m;
	while(cin>>n>>m){
		cout<<gcd(n,m)<<" "<<n*m/gcd(n,m)<<endl;
	}
	return 0;
}