#include <iostream>
using namespace std;
  
long gcd(long a, long b) {
    if (a < b) return gcd(b, a);
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}
  
int main() {
    long a, b;
    while (cin >> a >> b) {
        cout << gcd(a, b) << " " << a / gcd(a, b) * b << endl;      
    }
}