#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;
using ll = long long;
const int MAXN = 5004;

int gcd(int a, int b) {
    return b ? gcd(b, a%b) : a;
}

int main() {
    int a, b;
    while(~scanf("%d%d", &a, &b)) {
        int t = gcd(a, b);
        printf("%d %d\n", t, a/t*b);
    }
    return 0;
}

