#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	long a, b;
	long gcd;
	while (cin >> a >> b) {
		for (int i = min(a,b); i > 0; i--){
			if (a%i == 0 && b%i == 0){
				gcd = i;
				cout << i << " ";
				goto Cs;
			}
		}
		Cs:
		cout << a /gcd * b << endl;
		for (int i = 0; i < 0; i++){}
	}
}