#include<iostream>
using namespace std;

int main(){
  int a, b, x, y, q, r=1;
  while (cin >> a >> b){
    x=a; y=b;
    while (r>0){
      q=x/y; r=x%y;
      if (r>0){
	x=y; y=r;
      }
    }

    cout << y << " " << a/y*b << endl;
    r=1;
  }
  return 0;
}