#include<iostream>
#include<fstream>
using namespace std;


unsigned long long int GCM(unsigned long long int a,unsigned long long int b){
	while(a!=b){
		a>b? a-=b:b-=a;
	}
	return a;
}

int main()
{
	ifstream ifs("Text.txt");
	unsigned long long int a,b,L,G;
	
	ifs>>a;
	do{
	ifs>>b;
	if(a!=0&&b!=0){
	G=GCM(a,b);
	L=a*b/G;
	cout<<G<<" "<<L<<endl;
	}
	}while(ifs>>a);
}