#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
long long gcd(long long p, long long q){
	long long r;
	if (p > q){
		r = p;
		p = q;
		q = r;
	}
	if (q%p == 0) return p;
	else return gcd(q - (p*(q / p)), p);
}
int main(void){
	long long a, b, g;
	for (; scanf("%lld %lld", &a, &b) != EOF;){
		g = gcd(a, b);
		printf("%lld %lld\n", g, a*b / g);
	}
		return 0;
	}