#include <cstdio>
#include <queue>
#include <algorithm>
#include <vector>

using namespace std;

long long GCD(long long x, long long y){
	if(x < y) swap(x, y);
	long long r = x % y;
	while(r != 0){
		x = y;
		y = r;
		r = x % y;
	}
	
	return y;
}

int main(){
	long long a, b;
	while(scanf("%lld%lld", &a, &b) == 2){
		long long gcd = GCD(a, b);
		long long lcm = a / gcd * b;
		printf("%lld %lld\n", gcd, lcm);
	}
}
