#include <iostream>
#include <cstdio>

using namespace std;
//int solveGCD(int a, int b);

int a, b, tmp;

int solveGCD(int a, int b) {
  return b ? solveGCD(b, a%b) : a;
}

int main() {
  while(1) {
    scanf("%d %d", &a, &b);
    if(a<b) {tmp=a; a=b; b=tmp;}
    int gcd = solveGCD(a, b); 
    printf("%d %d\n", gcd, a/gcd*b);
  }
}