#include<iostream>
#include<cmath>

using namespace std;

int main()
{
	unsigned int  a,b;

	while(cin >> a >> b){
		int temp = a<b?a:b;

		int t = temp;
		while((a<b?b:a)%t || (a<b?a:b)%t){
			if(!t)
				break;
			--t;
		}
		cout <<t<<" "<<flush;

		t = a>b?a:b;
		while(true){
			if(!(t%a))
				if(!(t%b))
					break;
			++t;
		}
		cout <<t<<endl;
	}

	return 0;
}