#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define dump(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a, b;
  while(1) {
    if(!(cin >> a)) { break; }
    cin >> b;
    ll ans = 0;
    ll x = gcd(a, b);
    ll y = a / x * b;
    cout << x << ' ' << y << endl;
  }
  return 0;
}
