#include<stdio.h>
#include<iostream>
#include<iomanip>

#define ll long long
#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    return b == 0 ? a : gcd(b, a % b);
}

ll lcm(ll a, ll b) {
    return a * (b / gcd(a, b));
}


void solver() {
    ll a, b;
    while (cin >> a >> b) {
        cout << __algo_gcd(a, b) << " " << lcm(a, b) << endl;
    }
}

int main() {
    solver();
    return 0;
}