#include<iostream>
using namespace std;

int main()
{
    long int a, b, gcd, lcm, amari, wara, wari;
 
    while(cin>>a>>b){
        wara=0;
        wari=0;
        amari=0;
        gcd=0;
        lcm=0;

        if (a > b){
            wara = a;
            wari = b;
        }
        else{
            wara = b;
            wari = a;
        }
        amari = wara % wari;
        while (amari != 0)
        {
            wara = wari;
            wari = amari;
            amari= wara % wari;
        }
        gcd = wari;
        lcm = a * b / gcd;
        cout<<gcd<<" "<<lcm<<endl;
    }
}