#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b)
{
    return (b == 0)? a:gcd(b, a%b);
}
ll lcm(ll a,ll b)
{
    return a*b/gcd(a,b);

}
int main()
{
    ll a,b,c,d;
    cin >> a >> b;
    c=gcd(a,b);
    d=lcm(a,b);
    cout << c <<' ' << d << endl;
    return 0;
}

