#include <cassert>
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
  return a*b / gcd(a, b);
}

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