#include <iostream>
#include <vector>
#include <cmath>
#include <map>

using namespace std;

int gcd(int a,int b)
{
while(b != 0){
int c = a%b;
gcd(b,c);
}
return a;
}

int main()
{
int a,b;
while(~scanf("%d %d",&a,&b)){
printf("%d %d",gcd(a,b),(a*b)/gcd(a,b));
}
}