program fairness
  implicit none
  integer(8) :: a,b,c,k,i, a1,b1,c1
  read(*,*) a,b,c,k

  if (abs(a-b)>=1.0d+18) then
     write(*,*) 'Unfair'
     stop
  end if
  if (mod(k,2)==0) then
     write(*,*) a-b
  else
     write(*,*) b-a
  end if
  stop
end program fairness
