#include<cstdio>
#include<iostream>
int main()
{ int a,b,p,i;
 while(scanf("%d%d",&a,&b)!=EOF)
 {int i;
  if(a>b)p=a,a=b,b=p;
  for(i=a;i>=1;i--)
  if(a%i==0&&b%i==0){printf("%d ",i);break;}
  a=a/i;b=b/i;
  printf("%d\n",a*b*i);
 }
 return 0;}