#include <iostream>
#include<stdio.h>
using namespace std;
int main() {
	int a, b,i;
	while (cin >> a >> b) {
		if (a < b) {
			for (i = a; i > 0; i--) {
				if (a%i == 0 && b%i == 0)
					break;
			}
		}
		else {
			for (i = b; i > 0; i--) {
				if (a%i == 0 && b%i == 0)
					break;
			}
		}
		cout << i << " ";
		if (a < b) {
			for (i = b; i <= 2000000000; i += b) {
				if (i%a==0)
					break;
			}
		}
		else {
			for (i = a; i <= 2000000000; i += a) {
				if (i%b==0)
					break;
			}
		}
		cout << i << endl;
	}
	return 0;
}
