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