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


#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repback(i,n) for(int i=(int)n-1;i>=0;i--)
#define repa(i,a,n) for(int i=a;i<(int)(n);i++)
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 1e7, MAX_N = 1000000, MAX_M = 1000, MAX_W = 20, MAX_H = 20;
int asc(const void* a, const void* b) {
    return *(int*)a - *(int*)b;
}

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

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

int main() {
    int n,m;
    while (cin >> n >> m) {
        int a1 = gcd(n, m);
        int a2 = lcm(n, m);
        cout << a1 <<" "<< a2 << endl;
    }

    return 0;
}
