#include <iostream>
using namespace std;

int main() {
    int a,b;
    while (cin>>a>>b) {
        int gcd = a;
        while (!(a % gcd == 0 && b % gcd == 0)) {
            gcd--;
        }

        int i = 1;
        while (a * i % b != 0) {
            i++;
        }
        int lcm = a * i;
        cout << gcd << " " << lcm << endl;

    }
    return 0;
}