#include <stdio.h>
 int gcd(int x, int y){
 if(x%y == 0)
  return y;
 else
  return (gcd(y, x%y)); }

 int main(void){
 long long int x, y;
 while(scanf("%lld %lld", &x, &y)>0){
 long long int lcm=(x*y)/gcd(x, y);
 if(lcm == 0) break;
 printf("%lld %lld\n", gcd(x,y), lcm); }
 return 0;
} 
