
#include<iostream>
#include<cstdio>
using namespace std;

//?????§??¬?´???°
int gcd(int m, int n){
	if ((m == 0) || (n == 0)) return 0;


	while ((m != 0) && (n != 0)){
		m > n ? m = m%n : n = n%m;
	}
	if (m == 0) return n;
	else return m;
}

//????°???¬?????°
int lcm(int m, int n){
	if ((m == 0) || (n == 0)) return 0;

	return m*n / gcd(m, n);
}



int main()
{
	long long int a, b, n, m;
	while (scanf("%lld %lld", &a, &b) != EOF)
	{
		n = gcd(a, b);
		m = a * (long long int)(b / n);
		cout << n << " " << m << endl;
	}

	return 0;
}
