#include<iostream>
#include<stdio.h>
using namespace std;
int gcd(int a,int b){
	int n;
	n = a%b;
	if (n == 0)return b;
	else return gcd(b, n);
}
int main() {
	int a, b, c, n,s;
	while (cin >> a >> b) {
		if (a > b)n = gcd(a, b);
		else n = gcd(b, a);
		s = a / n*b;
		cout << n << " " << s << endl;
	}
	return 0;
}

