#include<iostream>
using namespace std;

int main(){
    int a,b;
    while (cin >> a >> b) {
        int koua,koub;
        koua = a;
        koub = b;
        if(koua < koub) {
            int temp = koua;
            koua = koub;
            koub = temp;
        }
        int r;
        while ((r =koua % koub) != 0) {
            koua = koub;
            koub = r;
        }
        int baia = a, baib = b;
        while(baia != baib) {
            if (baia < baib) {
                baia += a;
            }
            else {
                baib += b;
            }
        }
        cout<< koub << " " << baia << endl;
    }
    return 0;
}