#include <iostream>
#include <stdio.h>
#include <queue>
#include <cmath>

#define int64 long long int

using namespace std;

int GCD(int, int);
int LCM(int, int);

int main ()
{
    int a, b;
    while(cin >> a >> b){
        cout << GCD(a, b) << ' ' << LCM(a, b) << endl;
    }
    return 0;
}

int GCD(int a, int b){
    int buf;
    while(a % b != 0){
        buf = a % b;
        a = b;
        b = buf;
    }
    return b;
}

int LCM(int a, int b){
    int64 ab = (int64)a*b;
    return ab / GCD(a, b);
}