#include<stdio.h>
#include<math.h>

int main()
{   
    int a, b;
    int c;
    while (scanf("%d", &a) != EOF) {
        scanf("%d", &b);
        c = a * b;
        while (a != b) {
            if (a > b)
                a = a - b;
            else
                b = b - a;
        }
        printf("%d ", a);
        printf("%d\n", c / a);
    }
}