#include <bits/stdc++.h>
#define int long long
using namespace std;
 
constexpr int gcd(int a, int b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
 
constexpr int lcm(const int &a, const int &b) {
  return a / gcd(a, b) * b;
}
 
signed main() {
  int a, b;
  while (cin >> a >> b) cout << gcd(a, b) << ' ' << lcm(a, b) << endl;
}
