program main
implicit None
integer(8)::a,b,c,k
read *,a,b,c,k

if(abs(b-a) > 10e18)then 
	print 102,"Unfair"
	else
		print 101,(b-a)*((-1)**mod(k,2))
endif

101 format(i0)
102 format(a)
end program main