#include <cstdio>

unsigned long getGCD(unsigned long a, unsigned long b)
{
        if (!b) {
                return a;
        }

        return getGCD(b, a % b);
}

int main()
{
        unsigned long a, b;

        while (scanf("%lu %lu", &a, &b)) {
                unsigned long max = (a > b) ? a : b,
                                          min = (a < b) ? a : b;
                unsigned long gcd = getGCD(max, min);
                unsigned long lcm = a * b / gcd;
                printf("%lu %lu\n", gcd, lcm);
        }

        return 0;
}