//
//  main.cpp
//  CppTest
//
//  Created by Ryu on 2017/02/08.
//  Copyright ?? 2017??´ Ryu. All rights reserved.
//

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

long gcd(long x, long y){
    if (x > y) {
        if(x % y == 0){
            return y;
        }else{
            return gcd(y, x % y);
        }
    }else{
        if (y % x == 0) {
            return x;
        }else{
            return gcd(x, y % x);
        }
    }
}

int main(int argc, const char * argv[]) {
    // insert code here...
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    long a[50], b[50], g[50], l[50];
    int n = 0;
    while (cin >> a[n] >> b[n]){
        g[n] = gcd(a[n], b[n]);
        l[n] = a[n] * b[n] / g[n];
        //printf("d: %f, x: %.4f, y: %.4f\n", d, x[n], y[n]);
        n++;
    }
    
    
    for(int i = 0; i < n; i++){
        printf("%ld %ld\n", g[i], l[i]);
    }
    
    
    return 0;
}