
main :: IO ()
main = do
  [a,b,c,k] <- map read . words <$> getLine
  let res = solve a b c k
  putStrLn $ if res > 10^18 then "Unfair" else show res

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