{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

import System.Exit

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	[ a, b, c, k ] :: [Integer] <- map read . words <$> getLine
	when ( k <= 1 ) $ do
		print $ if k == 0 then a - b else b - a
		exitSuccess
	let
		diff = if k `mod` 2 == 1 || k == 0 then a - b else -a + b
	putStrLn $ if abs diff <= 10 ^ 18 then show diff else "Unfair"