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