import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val a = sc.nextLong()
  val b = sc.nextLong()
  val c = sc.nextLong()
  val k = sc.nextLong()

  val ans = a(a, b, c, k)
  println(ans)
}

private fun a(a: Long, b: Long, c: Long, k: Long): String {
  var ans = 0L
  if (k % 2L == 0L) {
    ans = a - b
  } else {
    ans = b - a
  }

  val max = 1000000000000000000
  if (ans > max) return "Unfair"

  return ans.toString()
}
