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