#include <iostream>
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 main(){
	int m, n;
	while(cin >> m >> n){
		int x = gcd(m, n);
		cout << x << " " << m / x * n << endl;
	}
    return 0;
}