#include<iostream>
#include<stdio.h>
using namespace std;
typedef __int64 ll;
ll gcd(ll a,ll b){
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}
int main(){
    ll a,b;
    while(scanf("%I64d %I64d",&a,&b)!=EOF){
        cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
    }
    return 0;
}