#include<iostream>
using namespace std;
int a=0;
int b=0;
long int c=0;
int n,m;
void koyaku(int i , int j)
{
  if(i == j)return ;
  if(i < j)
    {
      int x = i;
      i = j;
      j = x;
    }

  a = i - j;

  while(1)
    {
      b = j - a;
      
      if(a == b)return ;
    }
}

void kobai(int i , int j)
{
  if(i == j)return ;

  c = i * j / a;
}

int main()
{
  while(scanf("%d %d",&n,&m) != EOF)
    {
      koyaku(n,m);
      kobai(n,m);
      cout << a << " " << c << endl;
    }
}