#include <iostream>
using namespace std;
int gcd(int,int); //最大公約数
int lcm(int,int); //最小公倍数
int main(){
    int a,b,c,d;
    while (1){
        cin >> a >> b;
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
        if(cin.eof()){break;}
    }
}

int gcd(int a,int b){
    int n;
    for (int i=1;i<a;i++){
        if (a%i==0 && b%i==0)
            n = i;
    }
    return n;
}

int lcm(int a,int b){
    int n = a/gcd(a,b)*b;
    return n;
}