a, b = map(int, input().split()) x, y = max(a,b), min(a,b) while y : x, y = y, x%y print(f"{x}\n{a*b//x}")