#include<cstdio>
int gcd(int a, 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(){
  int a, b;
  while(scanf("%d%d", a, b)){
    int c=gcd(a,b);
    printf("%d %d\n", c, a*b/c);
  }
}

