#include <stdio.h>

int main() {
    int a, b;
    scanf("%d %d",&a, &b);
    if(a<b) {
        int temp;
        temp = a;
        a = b;
        b = temp;
    }

    int gcd = a, b_temp = b, r;
    while(b_temp != 0) {
        r = gcd % b_temp;
        gcd = b_temp;
        b_temp = r;
    }

    int lcm  = a*b/gcd;
    printf("%d\n%d\n",gcd,lcm);

    return 0;
}