#include<iostream>
#include<cmath>
using namespace std;
int d(int n,int m)
{
    int t;
    while(m!=0)
    {
        if(n<m) {t=n;n=m;m=t;}
        t=m;
        m=n%m;
        n=t;
    }
    return n;
}
int main()
{
    int t,n,m;
    while(1)
    {
        cin>>n>>m;
        cout<<t<<" "<<n*(m/t)<<endl;
    }
    return 0;
}