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)) print(g, x // g)