#include <iostream>

using namespace std;

int main()
{
	int a, b;
	while(scanf("%d%d", &a, &b) != EOF){
		int sa = a, sb = b;
		int c;
		while(b){
			c = a % b;
			a = b;
			b = c;
		}
		printf("%d %d\n", a, sa / a * sb);
	}
	return 0;
}