readLine :: String -> [Int]
readLine = map read . words

solve :: Int -> Int -> Int -> Int
solve a b k
  | even k = a - b
  | otherwise = b - a

solve' :: Int -> String
solve' i
  | abs i > 1000000000000000000 = "Unfair"
  | otherwise = show i

main = do
  [a, b, c, k] <- readLine <$> getLine
  putStrLn $ solve' $ solve a b k
