#include <bits/stdc++.h>
using namespace std;

template<class T>
T gcd(T a,T b){
	return b ? gcd(b,a % b) : a;
}

template<class T>
T lcm(T a,T b){
	return a / gcd(a,b) * b;
}

signed main(){
	int a,b;
	while(cin >> a >> b){
		cout << gcd(a,b) << " " << lcm(a,b) << endl;
	}
}

