#include <iostream>

using namespace std;

int main () {
    while (!cin.eof()) {
        int num1;
        int num2;
        cin >> num1 >> num2;
        int a = num1, b = num2;
        if (a<b) {
            a = num2;
            b = num1;
        }
        int q = a/b, r = a%b;
        while (r != 0) {
            a = b;
            b = r;
            q = a/b;
            r = a%b;
        }
        a = num1/b;
        cout << b << " " << a*num2 << endl;
        
    }
    return 0;
}