//--------------------------------------------------template----------------------------------------//
//c
#include <stdio.h>
#include <time.h>
#include <math.h>
//c++
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <complex>
#include <cmath>
//c++11
#include <tuple>
#define all(c) ((c).begin(),(c).end())
#define rall(c) (c).rbegin(),(c).rend()
//#define sort(v,n) sort(v,v+n)
//#define vsort(v) sort(v.begin(),v.end())
#define vvsort(v) sort(v.rbegin(),v.rend())
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
//---------------------------------------------------------------------------------------------//
ll a, b;

inline ll solve() {
	ll now = 2;
	ll ans = 1;
	while (now <= min(a, b)) {
		if (a%now == 0 && b%now == 0) {
			ans *= now;
			a /= now; b /= now;
		}
		else {
			now++;
		}
	}
	return ans;
}

inline ll solve2() {
	ll ans = max(a, b);
	for (ll i = max(a, b); i <= 2000000000; i+=max(a,b)) {
		if (i%a == 0 && i%b == 0) {
			ans = i;
			break;
		}
	}
	return ans;
}


int main() {
	while (cin >> a >> b) {
		cout << solve() << " " << solve2() << endl;
	}
	return 0;
}