A = list(map(int, input().split())) B = list(map(int, input().split())) if A == [0, 0] == B: print(0, 0) exit() ans = abs(A[0] * B[1] - A[1] * B[0]) from math import gcd g = gcd(A[0], A[1]) g1 = gcd(B[0], B[1]) g = gcd(g, g1) print(g, ans // g)