#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    int a,b;
    while(~scanf("%d%d",&a,&b))
    {
        int x = a;
        int y = b;
        while(y)
        {
            x = x%y;
            swap(x,y);
        }
        cout<<x<<" "<<a/x*b<<endl;
    }
    return 0;
}
