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


int gcd(int a, int b) {
    if (a < b)  return gcd(b, a);
    if (b == 0) return a;
    else        return gcd(b, a % b);
}

int main() {
    //freopen("0005.txt", "r", stdin);
    int a, b;
    while (cin >> a >> b) {
        int g = gcd(a, b);
        cout << g << " " << (a / g * b) << "\n";
    }
}