#include <iostream>
using namespace std;

int lcm(int n, int m) {
    if (n < m) swap(n, m);
    if (m == 0)
        return n;
    else
        return lcm(m, n % m);
}

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