#include<stdio.h>
int main(void)
{
	int a = 0,b = 0;
	int ans1 = 0,ans2 = 0,hozon = 0;
	int cnt1 = 2,cnt2 = 2;

	while (scanf("%d %d",&a,&b) != EOF)
	{
		cnt1 = 2;
		cnt2 = 2;
		if (a == b)
		{
			ans1 = a;
			ans2 = a;
		}
		else if (a % b == 0)
		{
			ans1 = b;
			ans2 = a;
		}
		else if (b % a == 0)
		{
			ans1 = a;
			ans2 = b;
		}
		else
		{
			ans1 = a;
			ans2 = b;
			if (ans1 < ans2)
			{
				hozon = ans1;
			}
			else
			{
				hozon = ans2;
			}
			while (1)
			{
				if (a % hozon == 0 && b % hozon == 0)
				{
					break;
				}
				hozon -= 2;
			}
			while (1)
			{
				while (ans1 < ans2)
				{
					ans1 = a * cnt1;
					cnt1++;
				}
				while (ans2 < ans1)
				{
					ans2 = b * cnt2;
					cnt2++;
				}
				if (ans1 == ans2)
				{
					break;
				}
			}
		}
		printf("%d %d\n",hozon,ans2);
	}

	return 0;
}