#include<iostream>
using namespace std;

int Gcd(int a,int b){
    int c;
    while(b!=0){
        c=b;
        b=a%b;
        a=c;
    }
    int g=a;
    return(g);
}

int main(){
    int m,n;
    long p;
    int k;
    while(cin>>m>>n){
        p=m*n;
        k=Gcd(m,n);
        cout<<k<<" "<<p/k<<endl;
    }
}