//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005

#include <iostream>
using namespace std;
#define ll long long
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }


int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	ll a, b;
	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
}