#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
LL gcd(LL a,LL b){
   if(a>b)return gcd(b,a);
   if(b%a==0)return a;
   return gcd(b%a,a);
}
int main(){
        LL a,b;
        while(cin>>a,cin>>b){
	      LL g=gcd(a,b);
	      cout<<g<<" "<<a/g*b<<endl;;
        }
	return(0);
}