a, b, x, N = map(int, input().split()) x1 = a*x+b x2 = a*x1+b r1 = 0 if x1%2 else N//2 r2 = 0 if x2%2 else N//2 print(r1, r2)