#include <stdio.h>
#include <iostream>
#include <math.h>
#define eps 1e-9
using namespace std;
long long int gcd(long long int a,long long int b)
{
    return b?gcd(b,a%b):a;
}
int main()
{
    long long int x,y;
    while(cin >> x >> y)
    {
        cout << gcd(x,y) << " " << x*y/gcd(x,y) << endl;
    }
    return 0;
}