#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<string>
using namespace std;

int LCM(int a, int b) {
	int result = 1;
	int i = 2;
	while(i <= a && i <= b) {
		if (a % i == 0 && b % i == 0) {
			result *= i;
			a /= i;
			b /= i;
		}
		else i++;
	}
	return result;
}

int GCD(int a, int b) {
	int result = 1;

	int lcm = LCM(a, b);

	a /= lcm;
	b /= lcm;

	return a * b*lcm;


}

int main() {
	int a, b, lcd;

	while (cin >> a >> b) {




		printf("%d %d\n", LCM(a, b),GCD(a,b));

	}

	//system("pause");
	return 0;
}
