#include <iostream>
using namespace std;

int gcd(int u, int v){
	while(u > 0){
		int t;
		if(u < v){ t = u; u = v; v = t; }
		u = u % v;
	}
	return v;
}

int main(){
	int a, b;
	while(cin >> a >> b){
		int g;
		int l;
		g = gcd(a,b);
		l = a / g * b;
		cout << g << " " << l << endl;
	}
	return 0;
}