#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 lcm(ll a, ll b) {
    return a * (b / __algo_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;
}