#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>

using namespace std;

int gcd(int m,int n){
	if(m == 0 || n == 0){
		return 0;
	}
	while(m != n){
		if(m > n){
			m -= n;
		}
		else{
			n -= m;
		}
	}
	return m;
}

int icm(int m,int n){
	if(m == 0 || n == 0){
		return 0;
	}
	return ((m / gcd(m,n)) * n);
}

int main(){
	int m = 0,n = 0;
	int resGcd = 0,resIcm = 0;
	while(cin >> m >> n){
		resGcd = gcd(m,n);
		resIcm = icm(m,n);
		cout << resGcd << " " << resIcm << endl;
	}
	return 0;
}