pow a b
	| b == 0 = 1
    | otherwise = a * pow a (b-1)
main = do
	[a,b,c,k] <- map read . words <$> getLine
	if abs (a-b) > pow 10 18 then putStrLn "Unfair" else if mod k 2 == 0 then print (a-b) else print (b-a)