#include <iostream>
 #include <cstdio>
 using namespace std;

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

   int main(void){
    int a,b;
    while(cin >> a >> b) {
       int lcm = a/gcd(a,b)*b;
      cout << gcd(a,b) << " " << lcm << endl;
    }
    return 0;
 }
