a,b,c,k=io.read("*n","*n","*n","*n")
if k%2==0 then
    if a-b>=10^18 then
        print("Unfair")
    else
        print(a-b)
    end
else
    if b-a>=10^18 then
        print("Unfair")
    else
        print(b-a)
    end
end