#include<iostream>
#include<cmath>
#include<cstdio>
#include<string>
#include<algorithm>


using namespace std;

int GCD(int a, int b);

int main()
{
  int a,b;
  while(cin >> a >> b)
  {
    if(a>b)
        swap(a,b);
    int x = GCD(a, b);
    cout << x << " " << (a/x)*b << endl;
  }
   return 0;
}

int GCD(int a, int b)
{
  if(b%a == 0)
    return a;
  else
    return GCD(b%a,a);
}