#include <iostream>

using namespace std;

int dev(int*,int*,int);

int main(void){
	int a,b,gcd;

	while(cin >> a){
		cin >> b;
		gcd=1;

		gcd*=dev(&a,&b,2);
		for(int i=3;i<(a<b?a:b);i+=2)
			gcd*=dev(&a,&b,i);

		cout << gcd << " " << a*b*gcd << endl;
	}

	return 0;
}

int dev(int *a,int *b,int n){
	int fac=1;
	
	while(*a%n==0&&*b%n==0){
		*a /= n;
		*b /= n;
		fac *= n;
	}

	return fac;
}