#pragma GCC optimize(2)
#define LOCAL0
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdio>
#include<queue>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
#define xx first 
#define yy second
#define INF 0x3f3f3f3f
void read(int &p)
{
    p=0;int flag=1;char c=getchar();
    while(!isdigit(c)) {if(c=='-') flag=-1;c=getchar();}
    while(isdigit(c)) {p=p*10+c-'0';c=getchar();}p*=flag;
}
ll x,y;

ll gcd(ll a,ll b){
    return b==0?a:gcd(b,a%b);
}

ll lcm(ll a,ll b){
    return max(a,b)/gcd(a,b)*min(a,b);
}

int main()
{
    #ifdef LOCAL
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif
    while(cin>>x>>y) printf("%lld %lld\n",gcd(x,y),lcm(x,y));
    return 0;
}
