#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int main()
{
    int a,b;
    while (cin >> a >> b)
    {
        cout << __gcd(a,b) << " " << (long long)a*b/__gcd(a,b) << endl;
    }
}