#include <cstdio>
#include <iostream>

using namespace std;

int gcd(int a,int b);

int main(){
	int a,b,c;
	while(cin >> a >> b){
		c = gcd(a,b);
		printf("%d %d\n",c,a/c*b);
	}


	return 0;
}

int gcd(int a,int b){
	if ( a==0 ) return b;
	return gcd ( b%a, a );
}