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

int main(){
	int a,b,gcd=1,lcm=1;
	while(cin >> a >> b){
		int c=a,d=b;
		for(int i = 2; i < a || i < b; i++){
			if(c%i==0&&d%i==0){
				c/=i;
				d/=i;
				lcm=gcd*=i;
			}
		}
		lcm*=c*d;
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}