#include <iostream>
using namespace std;

int main(){
	int a,b;
	while(cin >> a >> b){
		int gcd = a, lcm;
		while(a%gcd != 0 || b%gcd != 0) gcd--;
		lcm = (a/gcd)*(b/gcd)*gcd;
		cout << gcd <<" "<< lcm << endl;
	}
	return 0;
}