#include<iostream>
using namespace std;


int main()
{
	long a[100],b[100];
	int i=0;
	while(cin >> a[i] >> b[i]){i++;}
	for(int j=0;j<i;j++){
		long c;
		long d=a[j],e=b[j];
		if (a[j]<b[j]){c=a[j];a[j]=b[j];b[j]=c;}
		while(a[j]%b[j]!=0){
			c=a[j];
			a[j]=b[j];
			b[j]=c%b[j];
		}
		cout << b[j] <<" " <<d/b[j]*e <<  endl;
	}
    return 0;
}