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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	ll a,b;
	while(cin >> a >> b){
		ll gcd = __gcd((int)a,(int)b);
		ll lcm = a/gcd*b;

		cout << gcd << " " << lcm << endl;
	}
	return 0;
}

