#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;

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

int main()
{
	long long a,b;
	while(scanf("%lld%lld",&a,&b))
	{
		long long t=gcd(a,b);
		printf("%lld %lld\n",t,b/t*a);
	}
	return 0; 
}
