object Main extends App {
	val Array(a,b,c,k) = scala.io.StdIn.readLine.split(" ").map(_.toLong)

	var ans = 0L

	if(k%2 == 0){
		ans = a - b	
	}else{
		ans = b - a
	}

	if(ans.abs > 1000000000000000000L){
		println("Unfair")
	}else{
		println(ans)
	}

}