#include <iostream>

int  main() {
	long long  a = 0, b = 0, ad = 0, bd = 0, swap, amari, koba = 0;
	std::cin >> a >> b;
	ad = a; bd = b;
	if (b >= a) { swap = a; a = b; b = swap; }
		
	a:
		amari = a%b;
		if (amari == 0) {
			std::cout << b << " ";
			std::cout << ad*bd / b << std::endl;
		}
		else {
			a = b;
			b = amari;
			goto a;
		}
}