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

long long int num[1000][2];
int t;

void gcdlcm(int n, int m){
	long long int a, b;
	a = n;
	b = m;
	for(int i = 0; i < 1000; i++){
		if(n % m == 0){
			num[t][0] = m;
			num[t][1] = a*b/m;
			break;
		}
		else{
			n = n - (n/m)*m;
			swap(n, m);
		}
	}		
}
int main(){
	int a, b;
	t = 0;
	while(cin >> a >> b){
		gcdlcm(a, b);
		t++;
	}
	for(int i = 0; i < t; i++){
		cout << num[i][0] << " " << num[i][1] << endl;
	}
}