a,b,x,N = map(int, input().split()) if (a%2 == 0 or x%2 == 0) and b%2 == 0: T = 0 A = 0 elif (a%2 == 0 and b%2 == 1) or (a%2 == 1 and b%2 == 0 and x%2 == 1): T = N//2 A = N//2 elif x%2 == 0: T = 0 A = N//2 else: T = N//2 A = 0 print(T, A)