#include <iostream>
#include <cstdio>
using namespace std;

int gcd(int a, int b) {
    while(a != b){
        if(a > b)
            a = a - b;
        else
            b = b - a;
    }
    return b;
}

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

