import scala.math.BigInt

object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val a, b, c, k = BigInt(sc.nextLong())
  val max = BigInt(1000000000000000000L)
  val ret = a - b
  if (ret > max) {
    println("Unfair")
  } else if (k % 2 == 0) {
    println(ret)    
  } else {
    println(-ret)
  }

}