#include <iostream>
#include <algorithm>

using namespace std;

long gcd(long a, long b){
        if (b == 0) return a;
        else return gcd(b, a % b);
}

int main(){
        long long a, b;
        while (cin >> a >> b){
                if (a < b) swap(b, a);
                long g = gcd(a, b);
                cout << g << " " << a * b / g << endl;
        }
        return 0;
}