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