#include<iostream>
#include<cstdio>
using namespace std;

long func(long p, long q);
// int lcm(long p, long q);

int main() {
	long a, b;
	while(cin >> a >> b && a != EOF) {
		long gcd = func(a, b);
		long lcm = a / gcd * b;
		
		cout << gcd << ' ' << lcm << endl;
	}
}

long func(long p, long q) {
	long R = p % q;
	return (R==0? q : func(q,R));
}