#include<stdio.h>
#include<stdlib.h>

int main()
{
  log long int num1,num2,num;
  while(scanf("%lld %lld",num1,&num2)!=EOF){
  num=num1*num2;
  while(num1 !=num2)
  if(num1>num2)
  num1=num1-num2;
  else
  num2=num2-num1;
  }
  printf("%lld %dll\n",num1,num/num1);
  return 0;
}