#include<iostream>
using namespace std;

int main(){
	int a, b, c;
	long long int d, e;
	while (cin >> a >> b){
		c = a;
		d = a;
		e = b;
		while (a != b){
			if (a > b){
				c = a - b;
				a = b;
				b = c;
			}
			else {
				c = b - a;
				a = b;
				b = c;
			}
		}
		cout << c << " " << d*e/c << '\n';
	}

	return 0;
}