a,b,x0,N= map(int,input().split()) x1 = (a*x0+b)%2 if x1==0: print(N//2,0) else: print(0,N//2)