#include<iostream>
#include<string>
using namespace std;

long gcd(long a, long b) {
  long c;
  if(a < b) {
    long temp = a;
    a = b; 
    b = temp;
  }
 
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }

  return a;
}

int main(){
  long a, b;
  
  while(cin >> a >> b) {
    long GCD = gcd(a, b);
    long LCM = a * b / GCD;
    cout << GCD << " " << LCM << endl;
  }
  return 0;
}