#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
    ll m, n;
    while(scanf("%lld%lld", &m, &n) == 2){
        if(m > n){
            ll t = m;
            m = n;
            n = t;
        }
        ll r, a = m, b = n;
        while(n % m != 0){
            r = n % m;
            n = m;
            m = r;
        }
        printf("%lld %lld\n", r, a / r * b);
    }
}