#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)

int gcd(int a,int b)//O(log max(a,b)) 
{
    if(b == 0) return a;
    return gcd(b, a%b);
}

int main()
{
    int a,b, g;
    while(cin >> a >> b)
    {
        g = gcd(a,b);
        cout << g << " " << (a / g) * b << endl;
        
    }
    return 0;

}