#include <iostream>
#include <stdio.h>

int gcd(int c,int d)
{
	if(c<d) std::swap(c,d);
	if(c%d==0) return d;
	else return gcd(d,c%d);
}



int lcm(int c,int d,int f)
{
	return c*d/f;
}

int main()
{
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		int g=gcd(a,b);
		std::cout<<g<<" "<<lcm(a,b,g)<<std::endl;
	}
	return 0;
}