#include<stdio.h>
#include<math.h>

int main(){
  int a, b;
  while(scanf("%d %d", &a, &b) != EOF){
    int gcd=1;
    int n = 2;
    while(a!=1 && b!=1){
      if(a%n==0 && b%n==0){
	a = a/n;
	b = b/n; 
	gcd = gcd * n;
      }
      else{
	if(n > a)
	  break;
	else
	  n++;}
    }
    printf("%d %d\n", gcd, a*b*gcd);
  }
  return 0;
}