#include<iostream>
#include<string>
#include<cstring>
#include<cmath>
#include<vector>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<climits>
#include<algorithm>
#include<functional>
#include<iomanip>
#define LL long long
using namespace std;

int a,b;

int gcd(int x,int y){
    if(y==0) return x;
    return gcd(y,x%y);
}

int main(void){
    while(scanf("%d %d",&a,&b)!=EOF){
        int g=gcd(a,b);
        LL l=(LL)a*b/g;
        printf("%d %lld\n",g,l);
    }
    return 0;
}







