#include <iostream>

using namespace std;

int calc_gcd(int a, int b) {
        int bigger = a > b ? a : b;
        int lower = a > b ? b : a;

        int r = a % b;
        while (r != 0) {
                a = b;
                b = r;
                r = a % b;
        }

        return b;
}

int calc_lcm(int a, int b) {
        int bigger = a > b ? a : b;
        int lower = a > b ? b : a;

        int ans = bigger;
        while((ans % lower) != 0) {
                ans = ans + bigger;
        }

        return ans;
}

int main(void) {
        int a,b;

        while(cin >> a >> b) {
                cout << calc_gcd(a,b);
                cout << " ";
                cout << calc_lcm(a,b);
                cout << endl;
        }

        return 0;
}