nclude <iostream>

#include <cstdio>

#include <algorithm>

using namespace std;

int main(){

	unsigned long long a,b,c,d,e,f,maxx=0,data,minn=0,data2,m=0,n=0;

	while (scanf("%llu %llu",&a,&b)!=EOF){

		data=max(a,b)

		for (;;){

			if (a%data==0 && b%data==0){

				maxx=data;
				
				break;

			}

			data-=1;

		}

		data=min(a,b);

		data2=max(a,b);

		while(minn==0){	
	
			if (m!=0){

				if (data>=data2){

					n=data2;

					data2=data;

					data=n;

				}

				else{	

					n=data;

					data=data2;

					data2=n;
				
				}

				data*=2;

				m=1;

				if (data==data2) minn=data;	

			}		

		}

		cout<<maxx<<" "<<minn<<endl;

		maxx=0;

		minn=0;

	}

	return 0;

}