#include <bits/stdc++.h>
#include <vector>
using namespace std;
long long fpb(long long a, long long b){
	long long ret = 0;
	while(a % b != 0){
		ret = a % b;
		a = b;
		b = ret;
	}
	return b;
}
long long a, b;
int main(){
	while(cin >> a >> b){
		cout << fpb(a, b) << " " << (a*b)/fpb(a, b) << "\n";
	}
	return 0;
}