#include <bits/stdc++.h>
using namespace std;

int64_t gcd(int64_t a, int64_t b){
  while(a % b != 0){
    int64_t tmp = a % b;
    a = b;
    b = tmp;
  }
  return b;
}

int main(){
  int64_t a, b; 
  while(cin >> a >> b){ 
    cout << gcd(a,b) << " " << a * b / gcd(a,b) << endl;
  }
}
