#include<iostream>
using namespace std;
int gcd(int x, int y);
int main(){
  int n,m;
  while(cin >>n>>m){
    int x = gcd(n,m);
    cout <<x<<" "<<(n/x)*m<<endl;
  }
  return 0;
}
int gcd(int x, int y){
  int r = x%y;
  if(r == 0) return y;
  else return gcd(y,r);
}