#include <iostream>
using namespace std;

int GCD(int a, int b)
{
    int temp;
    while(temp!=0)
    {
      temp=a%b;
      a=b;
      b=temp;
    }
    return a;
}
int main()
{
    int a,b,lcm,gcd;
    while(1)
    {
    cin>>a>>b;
    gcd=GCD(a,b);
    lcm=a*b/gcd;
    cout<<gcd<<" "<<lcm<<"\n";

    }
    return 0;
}