program main
  implicit none

  integer(16) :: a, b, c, k, ans, max
  integer :: i

  read(*,*) a, b, c, k

  if(mod(k,2) == 0) then
     ans = a - b
  else
     ans = b - a
  end if
  
  max = 1
  do i = 1, 18
     max = max * 10
  end do
    
  if (abs(a-b) > max) then
     write(*,*) 'Unfair'
  else   
     write(*,*) ans
  end if


  
end program main


  
