main :: IO ()
main = do
  [a,b,_,k] <- map read.words <$> getLine :: IO [Integer]
  if abs(a-b) > 1000000000000000000
    then print "Unfair"
    else if even k
      then print $ a-b
      else print $ b-a
