#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int main(){
	int a,b;
	while(cin>>a>>b){
		int i;
		if(a>=b)
			i=b;
		else
			i=a;
		while(true){
			if(a%i==0&&b%i==0)
				break;
			i--;
		}
		cout<<i<<" ";
		if(a>=b)
			i=a;
		else
			i=b;
		while(true){
			if(i%a==0&&i%b==0)
				break;
			i++;
		}
		cout<<i<<endl;
	}
	return 0;
}