#include <stdio.h>

int gcd(int m, int n)
{
  if(m<n){
    int tmp = m;
    m = n;
    n = tmp;
  }

  while(1){
    if(n==0){
      return m;
    }

    int tmp = n;
    n = m%n;
    m = tmp;
  }
}

int lcm(int m, int n)
{
  return m/gcd(m,n)*n;
}

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

  return 0;
}