
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <functional>
#include <string.h>
#include <cmath>

using namespace std;

int gcd(int a, int b)
{
    while(b){
        a %= b;
        a ^= b ^= a ^= b;
    }
    return a;
}

int main()
{
    int a, b;
    while(cin>>a>>b){
        int g = gcd(a, b);
        cout << g << " " << a/g*b << endl;
    }
}