#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>

using namespace std;

typedef long long ll;

ll gcd(ll x, ll y){

    if(x<y) return gcd(y,x);
    if(y==0) return x;
    return gcd(y,x%y);

}

int main(){

    cin.sync_with_stdio(false);

    while(1){

        long long x,y;

        cin >> x >> y;

        long long m = gcd(x,y);

        cout << m << " " << x/m * y << endl;

    }

    return 0;

}