#include<iostream>
using namespace std;

int main(){
	long long a,b,c,d,e;
	std::cin>>a>>b;
    d=a;
	e=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*e)/a;
}