//输入两个正整数m和n,求其最大公约数及最小公倍数
//辗转相除法求最大公约数 最大公倍数=两数相乘/最小公约数
#include <stdio.h>
int main(){
int n,m;
int t;
int a,b;
scanf("%d",&n);
scanf("%d",&m);
int orign = n;
int origm = m;
while(m!=0) {
t=n%m;
n=m;
m=t;
}
a=orign*origm;
b=a/n;
printf("%d %d",n,b);
return 0;
}