//最小公倍数と最大公約数を求める
#include<iostream>
#include<cstdio>
#include<algorithm>
unsigned long a,b;//aとbの最小公倍数と最大公約数を求める
unsigned long G,L;//最大公約数と最小公倍数
int GCD(int x,int y){
  int c;
  c = x%y;
  if(c ==0)
    return y;
  else{
    return (GCD(y,c));
 }
}

int main(){
  while(scanf("%lu %lu",&a,&b) != EOF){
    if(a >b)
     G = GCD(a,b);
    else if(a <b)
      G = GCD(b,a);
    else
      G = a;
    
    L = (a*b)/G;
  printf("%lu %lu\n",G,L);

  }
  return 0;
}