#include<iostream>
using namespace std;
int main(){
long long a,b,c,d;
std::cin>>a>>b;
d=a*b;	
if(b>a){
long long d;
d = a;
a = b;
b = d;}
while(b!=0){
c = a % b;
a = b;
b = c;}
std::cout<<a<<" "<<d/a;
}