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

int u(int a, int b);
long l(int a, int b, int gcd);

int main(){
  int a, b;
  int gcd;
  long lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    gcd = u(a, b);
    lcm = l(a, b, gcd);
    std::cout << gcd << " " << lcm << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(1){
    if(a==0) return b;
    if(b==0) return a;
    if(a>=b){
      a = a % b;
    }else{
      b = b % a;
    }
  }
  
}

long l(int a, int b, int gcd){
  return (long)a * (long)b / (long)gcd;
}