#include <bits/stdc++.h>
using namespace std;
 
long gcd(long a, long b) {
  return a % b ? gcd(b, a % b) : b;
}
 
void solve(long a, long b) {
  int c = gcd(a, b);
  cout << c << " " << a / c * b << endl;
}
 
int main() {
  long a, b;
  while (cin >> a >> b) solve(a, b);
}
 