#include<iostream>
using namespace std;
int main()
{
  int a,b;
  while(cin.peek!=EOF)
  {
    cin>>a>>b;
    int w=a,f=b;
    int temp=a%b;
    while(temp!=0)
    {
      a=b;
      b=temp;
      temp=a%b;
    }
    cout<<b<<" "<<w/b*f<<endl;
  }
  return 0;
}