#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	 long GCD=0,LCM=0,a=0,b=0,xb=0,xa=0,r = 0,i=0;
	//while(scanf("%d %d",a,b)){
	while(cin>>a>>b){
    xa=a;
    xb=b;
		if(a==0 || b== 0){continue;}
		while(1){
			if(b==a){break;
			}
			if(a>b){
			a = a-b; 
			}
			else if(a<b){
			b = b-a;
			}
			
		}
		GCD=b;
		LCM=(xa*xb)/b;
		cout<<GCD<<" ";
		cout<<LCM;
		printf("\n");
		GCD=0;LCM = 0;xa = 0;xb = 0;a = 0;b = 0;
	}

	return 0;

}