#include <iostream>
using namespace std;
int main() {
    int a;
    int b;
    while(cin>>a>>b){
        int c=a*b;
    while(a%b!=0&&b%a!=0){
        if(a>b){
            a=a%b;
        }
        else if(b>a){
            b=b%a;
        }
    }
    if(a>b) cout<<b<<" "<<c/b;
        else cout<<a<<" "<<c/a;
        
    }
    return 0;
}