import math J=lambda:map(int,input().split()) A,B=J() C,D=J() d=abs(A*D-B*C) g=abs(math.gcd(A,B,C,D)) print(g,d//g if g else 0)