//#include<bits/stdc++.h>
#include<iostream>
#include <vector>
#include <cstdio>
#include<algorithm>
#include <utility>
#define SIZE 1001;
using namespace std;
int main() {
	long long ans, x, y, memox, memoy;
	while (cin >> x >> y) {
		memox = x; memoy = y;
		if (y > x) {
			swap(x, y);
		}
		while (1) {
			if (y == 0) {
				break;
			}
			x %= y;
			swap(x, y);
		}
		ans = (memox*memoy)/x;
		cout << x << " " << ans << endl;
	}
	return 0;
}