#include<cstdio>
#include<iostream>

using namespace std;

int gcm(int a, 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 long c,d,e;
	std::cin>>c>>d;

	e = gcm(c,d);

	std::cout<<e<<" "<<(c*d)/e;
}