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

int gcd(int a, int b) {

    int x, r;        
    if(b > a){
        x = a;
        a = b;
        b = x;
    }

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

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