#include<iostream>
#include<algorithm>
using namespace std;

int main(){
	int x[3], k = 1, a, b;
	
	while(cin >>x[1]>>x[2]){
		if(x[2] > x[1]) swap(x[1], x[2]);
		a = x[1];
		b = x[2];
		while(x[3 - k] != 0){
			x[k] = x[k] % x[3 - k];
			k = 3 - k;
		}
		cout <<x[k]<<" "<<a / x[k] * b<<endl;
		k = 1;
	}
	
	return 0;
}