#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define RG register int
#define rep(i,a,b)	for(RG i=a;i<=b;++i)
#define per(i,a,b)	for(RG i=a;i>=b;--i)
#define ll long long
#define inf (1<<29)
using namespace std;

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

int main()
{
	ll n,m,g;
	while(~scanf("%lld%lld",&n,&m))
	{
		g=gcd(n,m);
		printf("%lld %lld\n",g,n/g*m);
	}
	return 0;
}
