#include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair
typedef long long LL;

LL gcd( LL m, LL n )
{
  if((0 == m) || (0 == n))
    return 0;
	
  while(m != n)
    {
      if (m > n)
	m -= n;
      else
	n -= m;
    }
  return m;
}
LL lcm( LL m, LL n )
{
  if(( 0 == m ) || (0 == n))
    return 0;
	
  return ((m*n) / gcd(m, n));
}

int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(6);

  int INF = 1000000;

  int a,b;
  while(cin>>a>>b){
    cout << gcd(a,b) << " " << lcm(a,b) << endl;
  }


  return 0;
}