#include <bits/stdc++.h>
using namespace std;

typedef long long i64;

i64 gcd(i64 n, i64 m) {return (m == 0? n : gcd(m, n % m));}
i64 lcm(i64 n, i64 m) {return (n / gcd(n, m) * m);}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b;
  while(cin >> a >> b, !cin.eof()) cout << gcd(a, b) << " " << lcm(a, b) << endl;
}
