#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <fstream>
#include <set>
#include <utility>

using namespace std;
int main() {
	long long int n, m,nn,mm;
	while (cin >> n >> m) {
		nn = n; mm = m;

		if (nn < mm) {
			int swap = nn;
			nn = mm;
			mm = swap;
		}

		int k;
		k = nn%mm;

		while (k != 0) {
			nn == mm;
			mm = k;
			k = nn%mm;
		}
		cout << mm << " ";

		int countn = 1, countm = 1;

		while (1) {
			if (n*countn < m*countm) {
				countn++;
				if (n*countn == m*countm) {
					cout << n*countn << endl;
					break;
				}
			}
			else if (n*countn > m*countm) {
				countm++;
				if (n*countn == m*countm) {
					cout << n*countn << endl;
					break;
				}
			}
			else {
				cout << n*countn << endl;
				break;
			}
		}
	}
	
	
	return 0;
}