#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y){
	if(y == 0) return x;
	else return gcd(y, x % y);
}

int main(){
	ll a, b;
	while(cin >> a >> b){
		cin >> a >> b;
		ll x = gcd(a, b);
		cout << x << " " << a * b / x << endl;
	}
	return 0;
}

