#include <iostream>
#include <cstdio>
using namespace std;
int gcd(int a, int b){
    int tmp,q,r;
    if(a<b){
        tmp=b;
        b=a;
        a=tmp;
        }
        while(1){
        q=b/a;
        r=b%a;
        b=a;
        a=r;
        }
        return b;
        }
int main(void){
    int a, b;
    while(cin >> a >> b) {
        int lcm = a/gcd(a,b)*b;
        cout << gcd(a,b) << " " << lcm << endl;
        }
        return 0;
    
}
