from math import gcd, lcm
n, m = map(int, input().split())
print(gcd(n, m), lcm(n, m))