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

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

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

 
