#include <iostream>
using namespace std;
int main(void)
{
int n1, n2;
int low = 1, high;
int limit;
cin >> n1 >> n2;
limit = n1 > n2 ? n1 : n2;
for (int i = 2; i <= limit; i++)
{
if (n1 % i == 0 && n2 % i == 0)
low = i;
}
high = n1 * n2 / low;
cout << low << endl << high;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpCnsKCWludCBuMSwgbjI7CglpbnQgbG93ID0gMSwgaGlnaDsKCWludCBsaW1pdDsKCWNpbiA+PiBuMSA+PiBuMjsKCWxpbWl0ID0gbjEgPiBuMiA/IG4xIDogbjI7CgkKCWZvciAoaW50IGkgPSAyOyBpIDw9IGxpbWl0OyBpKyspCgl7CgkJaWYgKG4xICUgaSA9PSAwICYmIG4yICUgaSA9PSAwKQoJCQlsb3cgPSBpOwoJfQoJaGlnaCA9IG4xICogbjIgLyBsb3c7Cgljb3V0IDw8IGxvdyA8PCBlbmRsIDw8IGhpZ2g7CglyZXR1cm4gMDsKfQ==