#include <iostream>
using namespace std;

int gcd(int a, int b) {
    int c;
    while(a != 0) {
        c = a;
        a = b % a;
        b = c;
    }
    return b;
}

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

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