#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>

using namespace std;
int gcd(int x,int y)
{
	if (y==0)
	{
		return x;
	}
	else
	{
		return gcd(y, x%y);
	}
}
int lcm(int x, int y)
{
	return x / gcd(x, y)*y;
}

int main()
{
	long long a, b;
	long long Gcd, Lcm;
	while (scanf("%lld%lld",&a,&b) != EOF)
	{
		printf("%d %d\n", gcd(a, b), lcm(a, b));
	}
	return 0;
}