a,b,x,N=map(int,input().split()) n=[0,N//2][a&b&1>0] print(n,n)