#include <bits/stdc++.h>
//#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;

using namespace std;

ll gcd(ll a,ll b) {
	if (a < b) {
		swap(a, b);
	}
	if (b != 0) return gcd(b, a % b);
	else return a;
}


signed main() {
	ll a, b;
	while (cin >> a >> b) {
		ll mi = gcd(a, b);
		ll ma = a * b / mi;
		cout << mi << " " << ma << endl;
	}
}
