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