#include<stdio.h>
#include<string.h>

int main(void){
  int i,j,k,l,m=1,a,b,c[10],d[10],e;
  scanf("%d %d",&a,&b);
  if(a<b){
    k = b;
    b = a;
    a = k;
  }
  j = k = 0;
  for(i=2;i<a;i++){
    if(!(a%i)){
      c[j] = i;
      j += 1;
    }
  }
  for(i=2;i<b;i++){
    if(!(b%i)){
      d[k] = i;
      k += 1;
    }
  }

  for(i=j-1;i+1;i--){
    for(l=k-1;l+1;l--){
       if(c[i] == d[l]){
	printf("%d ",c[i]);
	m = 0;
	e = c[i];
	break;
      }
    }
    if(!m)
      break;
  }
  printf("%d",a*b/e);
  return 0;
}