a,b,x,n=map(int,input().split()) print(n//2,0) if (a*x+b)%2==0 else print(0,n//2)