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