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

long long gcd(int x, int y) {
    if(y == 0) return x;
    else return gcd(y, x % y);
}

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