#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int gcd(int x,int y){
	while(y){
		int t=x%y;
		x=y;
		y=t;
	}
	return x;
}
int main()
{
	int n,m;
	while(scanf("%d%d",&n,&m)==2){
		int x=gcd(n,m);
		printf("%d %d\n",x,n/x*m);
	}
}