//{Headers
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<algorithm>
#include<list>
#include<queue>
#include<deque>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<bitset>

using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > pii;
#define mp(x,y) make_pair(x,y)
typedef long long ll;
//}

int a,b;

int GCD(int a,int b){return b==0?a:GCD(b,a%b);}

void solve(){
    int gcd=GCD(a,b);
    int lcm=a/gcd*b;
    printf("%d %d\n",gcd,lcm);
}

int main(void){
//    freopen("in.txt","r",stdin);
    while(~scanf("%d%d",&a,&b))
        solve();
    return 0;
}

/*
8 6
50000000 30000000
*/

