#include <iostream>
using namespace std;

int gcd(int m, int n) {
    if (m == 0 || n == 0) {
        return 0;
    }
    while (m != n) {
        if (m > n) {
            m = m - n;
        } else {
            n = n - m;
        }
    }
    return m;
}

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