#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<set>
#include<bitset>
#include<map>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#define INF 0x3f3f3f3f
#define inf 100000000000000000
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
int a,b,temp;
int gcd(int a,int b)
{
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b)
{
    return a/gcd(a,b)*b;
}
int main()
{
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        if(a<b)
        {
            temp=a;a=b;b=temp;
        }
        printf("%d %d\n",gcd(a,b),lcm(a,b));
    }
    return 0;
}