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

int GCD(ll a, ll b){
  ll t;
  while(b){
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}
int main(){
  ll a, b;
  while(cin >> a >> b){
    ll gcd = GCD(a, b);
    cout << gcd << " " << a * b / gcd << "\n";
  }
  return 0;
}
