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

long long int gcd(long long int a, long long int b) {
    return (a == b) ? a : gcd(b % a, a);
}

long long int lcm(long long int a, long long int b) {
    return (a / gcd(a, b)) * b;
}

int main() {
    long long int a, b;
    while (cin >> a >> b) {
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
    }    
    return 0;
}
