#include<cstdio>
long long int gcd(long long int a, long long int b){
  if(a == 0){
    return b;
  }else if(a > b){
    return gcd(a%b, b);
  }else if(a < b){
    return gcd(b%a, a);
  }
}
int main(){
  long long int a, b;
  while(~scanf("%lld%lld", &a, &b)){
    //scanf("%d%d", a, b);
    long long int c=gcd(a,b);
    printf("%lld %lld\n", c, (a*b)/c);
  }
}
