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

int gcd(int a, int b){
    assert(a>=0 && b >=0);
    if(a < b){
        return gcd(b,a);
    }
    if(b == 0){
        return a;
    } else {
        return gcd(b,a%b);
    }
}

int lcm(int a, int b){
    assert(a>=0 && b >=0);
    if(b == 0){
        return a;
    } else {
        return gcd(b,a%b);
    }
}

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