program prob2
    implicit none
    integer(16) :: a,b,c,k
    read(*,*) a,b,c,k

    if(abs(a-b) > 1000000000000000000_16) then
        write(*,*) "Unfair"
    end if

    if(mod(k, 2) == 0) then
        write(*,*) a-b
    else
        write(*,*) b-a
    end if


    
    stop
contains
end program prob2