#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
  ll a, b, ret;
  while(cin >> a >> b){
    ret = __gcd( a, b);
    cout << ret << " " << (a * b) / ret << endl;
  }
}