#include<stdio.h>



unsigned long int gcd(unsigned long int one,unsigned long int two){		//Ååöñ
	
	unsigned long int temp,mod;
	
	if(one<two){
		temp=one;
		one=two;
		two=temp;
	}
	
	while(two!=0){
		
		mod=one%two;
		
		if(mod==0){
			
			return two;
		
		}else if(mod!=0){
			one=two;
			two=mod;
		}
	}
	return 0;
}


unsigned long int lcm(unsigned long int one, unsigned long int two){		//Å¬ö{
	return (one/gcd(one,two))*two;
}
	
int main(void){

	unsigned long int first,second;
	

	while(scanf("%d %d",&first,&second)!=EOF){
		
		if(first<=0||second<=0){
			break;
		}
		printf("%d %d\n",gcd(first,second),lcm(first,second));
	}
	
	return 0;
}