#include <bits/stdc++.h>
using namespace std;

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
    long long int a, b, r = 1;
    while (cin >> a >> b)
    {
        if (a < b)
        {
            long long int temp;
            temp = b;
            b = a;
            a = temp;
        }
        long long int tempa = a, tempb = b;
        r = b;
        b = a;
        while (r != 0)
        {
            a = b;
            b = r;
            r = a % b;
        }
        long long ans = tempa * tempb / b;
        cout << b << " " << ans << endl;
    }
    return 0;
}