program fairness
  implicit none
  integer(8) :: a,b,c,k,i, a1,b1,c1
  read(*,*) a,b,c,k
  
  do i = 1, k
     a1 = c+b
     b1 = c+a
     c1 = a+b
     a=a1
     b=b1
     c=c1
  end do
  if (abs(a-b)>=10**18) then
     write(*,*) 'Unfair'
  else
     write(*,*) a-b
  end if
  stop
end program fairness
