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

int main(){
	int a, b, min ,max, gcd, lcm;
	
	while(cin >> a >> b){
		
		min = min(a, b);
		max = max(a, b);
		
		for(int i = 0; i < min; i++){
			if(min % i == 0 && max % i == 0) gcd = i;
		}
		
		while(1){
			int i = 1;
			if( (max * i) % min == 0) {
				lcm = max *i;
				break;
			}
			else i++;
		}
		
		cout << gcd <<  " " << lcm << endl;
}