#include<iostream>
#include<stdio.h>

using namespace std;

//最大公約数 gcd
double gcd(double a, double b){
	while (a != b){
		a > b ? a -= b : b -= a;
	}
	if (a == b) return a;
}

//最小公倍数 lcm
double lcm(double a, double b){
	return a*b/gcd(a, b);
}

int main(){
	int a, b;
	while (cin >> a >> b){
		printf("%.0f %.0f\n", gcd(a, b), lcm(a, b));
	}
	return 0;
}