#include<iostream>
using namespace std;

int gcd(int a, int b){
	int r, tmp;

	if(a == 0 || b == 0){
		return 0;
	}

	if(a < b){
			tmp = a;
			a = b;
			b = tmp;
		}

		r =  a % b;
		while(r != 0){
			a = b;
			b = r;
			r = a % b;
		}
		return b;
}

int lcm(int a, int b){
	if(a == 0 || b == 0){
		return 0;
	}

	return (a * b/ gcd(a,b));
}

int main(){
	int a, b, r;
	int lcm_num, gcd_num;
	while(cin >> a >> b){
		gcd_num = gcd(a, b);
		lcm_num = lcm(a, b);
		cout << gcd_num << " " << lcm_num << endl;
	}
}