#include<cstdio>
typedef long long lolo;
lolo gcd(lolo a, lolo b){
  if(b == 0)
    return a;
  else
    return gcd(b,a%b);
}
void solve(lolo a, lolo b){
  lolo ans = gcd(a,b);
  printf("%lld %lld\n",ans,a / ans * b);
}
int main(){
  lolo a;
  lolo b;
  while(scanf("%lld %lld",&a,&b) != EOF)
    solve(a,b);
}

