from math import gcd
a, b = map(int, input().split())
c, d = map(int, input().split())
g = gcd(gcd(gcd(a, b), c), d)
if g == 0:
    print(0, 0)
else:
    D = abs(a * d - b * c)
    t = D // g // g
    print(g, t * g)