#include <iostream>

int main() {
	long long int a, b;
	while( std::cin >> a >> b ) {
		long long int m = ( a >= b ) ? a : b, n = ( a >= b ) ? b : a;
		while( n != 0 ) {
			long long int r = m % n;
			m=n; n=r;
		}
		std::cout << m << " ";
		long long int l = a * b / m;
		std::cout << l << std::endl;
	}
}