https://www.acmicpc.net/problem/10158
w,h=map(int,input().split())
p,q=map(int,input().split())
t=int(input())
x=t%(2*w)
y=t%(2*h)
if x<=w-p:
p+=x
elif x<=2*w-p:
p=w-(x-w+p)
else:
p=x-2*w+p
if y<=h-q:
q+=y
elif y<=2*h-q:
q=h-(y-h+q)
else:
q=y-2*h+q
print(p,q)