#include<iostream>
#include<cstdio>
using namespace std;
int gcd(int u, int v)
{
  int r, z;
  if(v > u)
  {
    z = u;
    u = v;
    v = z;
  }
  while((r = u%v) != 0)
  {
    u = v;
    v = r;
  }    
  return v;  
}

int main(void)
{
  int a, b;
  while(scanf("%d %d", &a, &b) != EOF)
  {      
    printf("%d %d\n", gcd(a,b), b/gcd(a,b)*a);
  }
  return 0;
}

