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