#include <cstdio>

int main()
{
    int a, b;
    int m, n, temp;

    while (scanf("%d %d", &a, &b) != EOF) {
        m = a;
        n = b;
        if (m < n) {
            temp = m;
            n = m;
            m = temp;
        }

        while (n > 0) {
            temp = n;
            n = m % n;
            m = temp;
        }

        printf("%d %d\n", m, a / m * b);
    }

    return 0;
}