#include <iostream>
using namespace std;

int setGcd(int a, int b) {
    int gcd;
    
    if(a == 0 || b == 0) return 0;
    
    while(a != b) {
        if(a > b) a -= b;
        else b -= a;
    }
    gcd = a;
    return gcd;
}

int setLcm(int a, int b) {
    int lcm;
    
    if(a == 0 || b == 0) return 0;
    lcm = a / setGcd(a,b) * b;
    
    return lcm;
}

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