#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<climits>
using namespace std;
static long long a, b;

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

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