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

ll gcd(ll a, ll b){
      if(b==0){
            return a;
      }else{
            return gcd(b,a%b);
      }
}


int main(){
      ll a,b,c,d;
      while(cin >>a >>b){
            c = gcd(a,b);
            d = a*(b/c);
            cout << c <<' '<< d << endl;
      }
}
