#include <iostream>
#include <stdio.h>
using namespace std;

int main(){

int small,big,i,c,kouyaku,koubai;

while(cin >> small >> big){

if(small>big){//大小比較
c=big;
big=small;
small=c;
}

for(i=1;i<=big;i++){//最大公約数
if(big%i==0 && small%i==0)kouyaku=i;
}

koubai=(big*small)/kouyaku;

cout << kouyaku << " " <<koubai << endl;//出力
}
return 0;
}