#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<algorithm>
#define MAXM 20006
#define MAXN 1006
#define INF 2100000000
using namespace std;
int n,m;
int gcd(int x,int y)
{
    if(y==0) return x;
    return gcd(y,x%y);
}
int main()
{
    while(scanf("%d",&n)==1)
    {
        scanf("%d",&m);
        int g=gcd(n,m);
        printf("%d %d\n",g,(n/g)*m);
    }
}