//
//  main.c
//  c
//
//  Created by ????????? on 2016/12/10.
//  Copyright ?? 2016??´ ?????????. All rights reserved.
//

#include <stdio.h>

int main(){
    long long a, b, r, lcm, x, y;
    while (scanf("%lld %lld",&a,&b) != EOF) {
        x=a;
        y=b;
        for (;;) {
            r=x%y;
            if (r==0)
                break;
            x=y;
            y=r;
        }
        lcm=a*b/y;
        printf("%lld %lld\n",y,lcm);
    }

    return 0;
}