#include <iostream>
#include <cstdio>
using namespace std;
int main(){
	double a, b;
		while(cin >> a >> b){
		double c = a, d = b;
		while(c != d){
			if(c > d) c = c - d;
			else d = d - c;
		}
		d = a * b / c;
		printf("%.0lf %.0lf\n", c, d);
	}
	return 0;
}