#include<stdio.h>
void gcd_lcm(int *x,*y,*gcd,*lcm) {
    int a=*x,b=*y;
    int tempA=a,tempB=b;
    while(tempB!=0) {
        int t=tempB;
        tempB=tempA%tempB;
        tempA=t;
    }
    *gcd=tempA;
    *lcm=(a*b)/(*gcd);
}
int main() {
    int x,y,gcd,lcm;
    if(scanf("%d",&x)!=1||scanf("%d",&y)!=1) {
        printf("Invalid input\n");
        return 0;
    }
    if(x<=0||y<=0){
        printf("Invalid input\n");
        return 0;
    }
    gcd_lcm(&x,&y,&gcd,&lcm);
    printf("%d %d\n",gcd,lcm);
    return 0;
}