#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
typedef long double lb;
using namespace std;
ll gcd(ll P, ll Q){
  return Q ? gcd(Q,P % Q):P;
}
ll lcm(ll P, ll Q){
  return P / gcd(P,Q) * Q;
}
int main(){
  ll P,Q;
  while(cin >> P >> Q){
    cout << gcd(P,Q) << " " <<  lcm(P,Q) << endl;
  }
}
