/* -*- coding:utf-8 -*- */

#include <iostream>

using namespace std;

long gcd(long a, long b)
{
  if(b == 0) return a;
  else return gcd(b, a%b);
}

long lcm(long a, long b)
{
  return ((a / gcd(a, b)) * b);
}

int main()
{
  long a, b;
  while(cin >> a >> b, !cin.eof()) 
    cout << gcd(a,b) << ' ' << lcm(a,b) << endl;
  
  return 0;
}