#include <iostream>

#include <algorithm>


using namespace std;
int main()
{

double x,y,n,a,b;

while(cin>>x>>y)
{
a=x;
b=y;
if(x>y)
while(x%y!=0)
{
n=x%y;
x=y;
y=n;
cout<<y<<" "<<a*b/y<<endl;
}
else
while(y%x!=0)
{
n=y%x;
y=x;
x=n;
cout<<x<<" "<<a*b/x<<endl;
}

}
return 0;
}