#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

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

// x, y, gcd
int lcm(int x, int y, int g) {
    return x/g*y;
}

int main(){
    int a, b, g, l;

    while (cin >> a >> b) {
        g = a > b ? gcd(a, b) : gcd(b, a);
        l = a > b ? lcm(a,b,g) : lcm(b,a,g);

        cout << g << " " << l << endl;
    }

    return 0;
}
