#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include <sstream>
using namespace std;
int main(void){
    long a,b,tmp;
    while(cin >> a >> b){
        long ab = a * b;
        if(a<b){
            tmp = a;
            a = b;
            b = tmp;
        }
        long r = a % b;
        while(r!=0){
            a = b;
            b = r;
            r = a % b;
        }
        cout << b << " " << ab/b << endl;

    }
}