#include <cstdio>

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

        return getGCD(b, a % b);
}

int getLCM(int a, int b)
{
        int lcm = a;

        while (lcm % b) {
                lcm+=a;
        }

        return lcm;
}

int main()
{
        int a, b;

        while (scanf("%d %d", &a, &b)) {
                int max = (a > b) ? a : b,
                    min = (a < b) ? a : b;
                printf("%d %d\n", getGCD(max, min), getLCM(max, min));
        }

        return 0;
}