#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<functional>
#include<queue>
#include<math.h>
#define INF 999999

using namespace std;

typedef long long ll;

ll gcd(ll a, ll b)
{
	if (b == 0)return a;
	else return gcd(b, a%b);
}

int main()
{
	ll a, b;
	while (cin >> a >> b) {

		ll c = gcd(a, b);
		ll d = a*b / c;

		printf("%lld %lld\n", c, d);
	}

	return 0;
}