
#include <iostream>
#include <stdio.h>
using namespace std;

int 
gcd ( int a, int b )
{
  int c;
  while ( a != 0 ) {
     c = a; a = b%a;  b = c;
  }
  return b;
}

int lcm(int a, int b)
{
    int temp = gcd(a, b);

    return temp ? (a / temp * b) : 0;
}

int main()
{
    int a,b;
    while(cin>>a>>b) {
		printf("%d %d\n",gcd(a,b),lcm(a,b));
    }
    return 0;
}