Problem:
 Score : 300 points    Problem Statement Takahashi, Nakahashi and Hikuhashi have integers A , B and C , respectively.
After repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:   Each of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.   However, if the absolute value of the answer exceeds 10^{18} , print Unfair instead.      Constraints  1 \leq A,B,C \leq 10^9  0 \leq K \leq 10^{18}  All values in input are integers.         Input Input is given from Standard Input in the following format:  A  B  C  K       Output Print the integer Takahashi will get minus the integer Nakahashi will get, after repeating the following operation K times.
If the absolute value of the answer exceeds 10^{18} , print Unfair instead.        Sample Input 1 1 2 3 1      Sample Output 1 1  After one operation, Takahashi, Nakahashi and Hikuhashi have 5 , 4 and 3 , respectively. We should print 5-4=1 .       Sample Input 2 2 3 2 0      Sample Output 2 -1       Sample Input 3 1000000000 1000000000 1000000000 1000000000000000000      Sample Output 3 0

Solution (Python):
a,b,c,k=map(int,input().split())
print((-1)**k*(a-b))

Solution (Python):
a,b,c,k=map(int,input().split())
print((-1)**k*(a-b))

Solution (Python):
def main():
    a, b, c, k = map(int, input().split())

    if k % 2 == 1:
        print(b - a)
    else:
        print(a - b)


'''
    for i in range(k):
        temp_a = a
        temp_b = b
        temp_c = c

        a = temp_b + temp_c
        b = temp_a + temp_c
        c = temp_a + temp_b

    answer = a - b
    if answer > 10**18:
        print('Unfair')
    else:
        print(answer)
'''

if __name__ == '__main__':
    main()

Solution (Python):

import sys

MAX = 10 * 18


def solve(A: int, B: int, C: int, K: int):
    ans = A - B
    if K % 2 != 0:
        ans *= -1
    print(ans)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    K = int(next(tokens))  
    solve(A, B, C, K)

if __name__ == '__main__':
    main()

Solution (Python):
a, b, c, k = map(int,input().split())
print("Unfair" if abs(a-b) >= 1e18 else a-b if k % 2 == 0 else b-a)

Solution (Python):
a,b,c,k = map(int,input().split())
if abs(a-b) > 10 ** 18:
    print("Unfair")
elif k % 2 == 1:
    print(b - a)
else:
    print(a - b)

Solution (Python):
A, B, C, K = map(int, input().split())

if K % 2 == 1:
    print(B-A)
elif K % 2 == 0:
    print(A-B)
else:
    print('Unfair')

Solution (Python):
A, B, C, K = map(int, input().split())

if K % 2 == 1:
    print(B-A)
elif K % 2 == 0:
    print(A-B)

Solution (Python):
a, b, c, k = map(int, input().split())
ans = 0
if k % 2 == 0:
    ans = a - b
else:
    ans = b - a

if ans > 10 ** 18:
    print("Unfair")
else:
    print(ans)

Solution (Python):
a,b,c,k=map(int,input().split())
if abs(a-b)>10**18:
    print('Unfair')
elif k%2==0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
A, B, C, K = map(int, input().split())
if K % 2 == 0:
  print(A-B)
else:
  print(B-A)

Solution (Python):
A, B, C, K = map(int, input().split())
if K%2 == 0:
  print(A-B)
else:
  print(B-A)

Solution (Python):
A, B, C, K = [int(x) for x in input().split()]
if(K%2==0):
  ans = A - B
else:
  ans = B - A
if(abs(ans)>10**18):
  print('Unfair')
else:
  print(ans)

Solution (Python):


def main():
    A, B, _, K = map(int, input().split())
    ans = A - B if K % 2 == 0 else B - A
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
a,b,c,k =  map(int,input().split())

if abs(a-b) > 10**18 or abs(b-a) > 10**18:
    print('Unfair')
elif k%2==0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
A,B,C,K = map(int,input().split())
if A - B > 10**18 or B - A > 10**18:
  print('Unfair')
elif K % 2 == 0:
  print(A - B)
elif K % 2 == 1:
  print(B - A)

Solution (Python):
A,B,C,K  = map(int,input().split())
ans = int((A-B)*((-1)**K))
print(ans if abs(ans)< 1e18 else "Unfair")

Solution (Python):

import sys
input=sys.stdin.readline

def main():
    a,b,c,k = map(int,input().split())

    if abs(a-b)>10**18:
        print("Unfair")
    elif k % 2==0:
        print(a-b)
    else:
        print(b-a) 

if __name__=="__main__":
    main()

Solution (Python):
a, b, c, k = map(int, input().split())
if abs(a-b) > 10 ** 18:
	print('Unfair')
else:
	print(a - b if k % 2 == 0 else b - a)

Solution (Python):
A,B,C,K=map(int,input().split())

t=A-B
if 10**18<t:
    print('Unfair')
elif K%2==0:
    print(t)
else:
    print(-t)

Solution (Python):
a, b, c, k = map(int, input().split())

if k%2 == 0:
    ans = a-b
else:
    ans = b-a

if abs(ans)> 10**18:
    print('Unfair')
else:
    print(ans)

Solution (Python):
a, b, c, k = map(int, input().split())
cons = (-1)**k
ans = (a - b) * cons

if abs(ans) > 10**18:
    print("Unfair")
else:
    print(ans)

Solution (Python):
A, B, C, K = map(int, input().split())

if K%2 == 0:
    if abs(A-B) <= 10**18:
        print(A-B)
    else:
        print("Unfair")
else:
    if abs(B-A) <= 10**18:
        print(B-A)
    else:
        print("Unfair")

Solution (Python):
A, B, C, K = map(int, input().split())

if K % 2 == 0:
    if abs(A-B) > 10**18:
        print("Unfair")
    else:
        print(A-B)
        
else:
    if abs(B-A) > 10**18:
        print("Unfair")
    else:
        print(B-A)

Solution (Python):
import sys
import copy
import math
import itertools
import numpy as np
l = [int(c) for c in input().split()]
A = l[0]
B = l[1]
C = l[2]
K = l[3]

if K%2==0:
    print(A-B)
else:
    print(B-A)

Solution (Python):







e1,e2,e3 ,e4= map(int,input().split())




if e4%2==0 or e4==0:
    print(e1-e2)
elif e4%2==1 :
    print(-(e1-e2))
elif abs(e1-e2)>=10**18:
    print("Unfair")

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

a,b,c,k=I()

if abs(b-a)>10**18:
    print("Unfair")
else:
    if k%2==0:
        print(a-b)
    else:
        print(b-a)

Solution (Python):
a,b,c,k=map(int,input().split())
if abs(b-a)>10**18:
    print("Unfair")
else:
    if k%2==0:
        print(a-b)
    else:
        print(b-a)

Solution (Python):
a, b, c, k = map(int, input().split())

if k % 2:
    ans = b - a
else:
    ans = a - b

if abs(ans) > 10**18:
    print("Unfair")
else:
    print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

a, b, c, k = map(int, input().split())

ans = None
if k % 2 == 0:
    ans = a - b
else:
    ans = b - a

if abs(ans) > 10 ** 18:
    print('Unfair')
else:
    print(ans)

Solution (Python):


a, b, c, k = map(int, input().split())

if k%2==0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
import sys
a, b, c, k = map(int, input().split())
ans = a - b if k % 2 == 0 else b-a
if abs(ans) > 10 ** 18:
    print('Unfair')
    sys.exit()

print(ans)

Solution (Python):

A, B, C, K = map(int, input().split())
r = K % 2
if r == 0:
    ans = A - B
else:
    ans = B - A

if abs(ans) > 10**18:
    print('Unfair')
else:
    print(ans)

Solution (Python):
def main():
    a, b, c, k = map(int, input().split())

    if k % 2 == 0:
        ans = a - b
        if abs(ans) > 10 ** 18:
            print("Unfair")
        else:
            print(ans)
    else:
        ans = b - a
        if abs(ans) > 10 ** 18:
            print("Unfair")
        else:
            print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
A, B, C, K = map(int, input().split())

if abs(A-B) > 10**18:
    print('unfair')
else:
    if K % 2 == 0:
        print(A-B)
    else:
        print((A-B)*(-1))

Solution (Python):
a, b, c, k = map(int, input().split())
print(a-b) if k%2 == 0 else print(b-a)

Solution (Python):
A,B,C,K = map(int,input().split())
if K % 2 == 0:
  print(A - B)
else:
  print(B - A)

Solution (Python):
A, B, C, K = map(int, input().split())

o = B - A
e = A - B
if K % 2 == 0:
  r = e
else:
  r = o 
print(r)

Solution (Python):
a,b,c,k = map(int,input().split())
ans = b - a

if k % 2 == 0:
    ans = a - b
    
print(ans)

Solution (Python):
a,b,c,k=map(int,input().split())
if k%2==1:
  print(b-a)
else:
  print(a-b)

Solution (Python):
a,b,c,k=map(int,input().split())

if a==b:
  print(0)
else:
  ans_0=a-b
  ans_1=b-a
  if abs(ans_0)>=10**18:
    print("Unfair")
  elif k%2!=0:
    print(ans_1)
  elif k%2==0:
    print(ans_0)

Solution (Python):
A, B, C, K = map(int, input().split())
print(A - B if K % 2 == 0 else B - A)

Solution (Python):
a, b, c, k = map(int, input().split())

ans = a-b
if k % 2 == 1:
    ans = -ans

print(ans)

Solution (Python):
def solve():
    A, B, _, K = [int(i) for i in input().split()]
    if abs(A - B) > 10 ** 18:
        print('Unfair')
        exit()
    if K % 2 == 0:
        print(A - B)
    else:
        print(B - A)

if __name__ == "__main__":
    solve()

Solution (Python):
a,b,c,k = map(int, input().split())
if k%2 == 0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
A, B, C, K = map(int,input().split())
a = [A, B, C]
if K % 2 == 0:
  print(A - B)
else:
  print(B - A)

Solution (Python):
A,B,C,K = map(int,input().split())
if K % 2 == 0:
    ans = A - B
else:
    ans = B - A

if abs(ans) > 1e18:
    print('Unfair')
else:
    print(ans)

Solution (Python):
a,b,c,k = map(int,input().split())
if k % 2 == 0:
    ans = a - b
else:
    ans = b - a
print(ans)

Solution (Python):
a,b,c,k = map(int,input().split())
if k % 2 == 0:
    ans = a - b
else:
    ans = b - a

if abs(ans) >= 10**18:
    print("Unfair")
else:
    print(ans)

Solution (Python):
def resolve():
    '''
    code here
    '''
    A, B, C, K = [int(item) for item in input().split()]

    if K % 2 == 0:
        res = A- B
    else:
        res = B -A

    print(res)
if __name__ == "__main__":
    resolve()

Solution (Python):
a,b,c,k = map(int,input().split())
if k%2 == 0:
    if abs(a-b)>10**18:
        print("Unfair")
    else:
        print(a-b)
else:
    if abs(b-a)>10**18:
        print("Unfair")
    else:
        print(b-a)

Solution (Python):
a,b,c,k = map(int,input().split())
if k%2 == 0:
    if abs(a-b) >= 10**18:
        print("Unfair")
    else:
        print(a-b)
else:
    if abs(a-b) >= 10**18:
        print("Unfair")
    else:
        print(b-a)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B, C, K = LI()

    ans = (-1) ** (K % 2) * (A - B)
    if abs(ans) > 10 ** 18:
        print('Unfair')
    else:
        print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):
a, b, c, k = [int(_) for _ in input().split()]
print((-1) ** k * (a - b))

Solution (Python):
A,B,C,K=list(map(int, input().split()))
sum=A+B+C
print((A-B)*(-1)**(K%2))

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

a,b,c,k=map(int,input().split())
if k%2:
    print(b-a)
else:
    print(a-b)

Solution (Python):
a, b, c, k = map(int,input().split())

if a==b==c:
    print(0)
    exit()
    
a_=b+c
b_=a+c
c_=a+b

if k==0:
    print(a-b)
elif k%2==0:
    print(a-b)
else:
    print(a_-b_)

Solution (Python):
A,B,C,K = map(int, input().split())
limit = 1e18

if abs(A-B)>=limit:
    print('Unfair')
else:
    if K%2==0:
        print(A-B)
    else:
        print(B-A)

Solution (Python):
A, B, C, K = list(map(int, input().split()))
if K % 2 == 0:
  print(A-B)
else:
  print(B-A)

Solution (Python):
'''
Created on 2020/08/17

@author: harurun
'''

import sys
pin=sys.stdin.readline
pout=sys.stdout.write
perr=sys.stderr.write

mod=1000000000000000000
A,B,C,K=map(int,pin().split())
if abs(A-B)>mod:
  print("Unfair")
elif K%2==0:
  print(A-B)
else:
  print(B-A)

Solution (Python):
'''
Created on 2020/08/17

@author: harurun
'''

def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  mod=1000000000000000000

  A,B,C,K=map(int,pin().split())
  if abs(A-B)>mod:
    print("Unfair")
  elif K%2==0:
    print(A-B)
  else:
    print(B-A)

main()

Solution (Python):
a,b,c,k=map(int,input().split())
if abs(a-b)>10**18:
    print("unfair")
else:
    if k%2==0:
        print(a-b)
    else:
        print(b-a)

Solution (Python):
L=[int(x) for x in input().split()]
A=L[0]
B=L[1]
K=L[3]
if K%2==0:
  d=A-B
else:
  d=B-A
if d>10**18:
  print('Unfair')
else:
  print(d)

Solution (Python):

def resolve():
    import sys
    input = sys.stdin.readline
    
    
    
    a, b, c, k = [int(x) for x in input().rstrip().split(" ")]

    if abs(a - b) > 10**18:
        print("Unfair")
        return

    if k % 2 == 0:
        print(a - b)
    else:
        print(b - a)

if __name__ == "__main__":
    resolve()

Solution (Python):
A,B,C,K = map(int,input().split())

if abs(A-B) > 10**18:
  print("Unfair")
else:
  print((A-B)*(-1)**K)

Solution (Python):
A,B,C,K = map(int,input().split())

if K%2 == 0:
    ans = A - B 
else:
    ans = B - A
print(ans)

Solution (Python):
a, b, c, k = map(int, input().split())
print(b-a if k & 1 else a-b)

Solution (Python):
A, B, C, K = map(int,input().split())

if abs(A - B) > 10 ** 18:
    print("Unfair")
elif K % 2 == 0:
    print(A - B)
else:
    print(B - A)

Solution (Python):
a, b, c, k = map(int, input().split())
print(a - b if k % 2 == 0 else b - a)

Solution (Python):
a, b, c, k = map(int, input().split())
ans = a - b if k % 2 == 0 else b - a
print(ans)

Solution (Python):
a, b, c, k = map(int, input().split())
print(a - b if k % 2 == 0 else b - a)

Solution (Python):
A,B,C,K = map(int,input().split())
if K & 1:
    print(B-A)
else:
    print(A-B)

Solution (Python):
a,b,c,K=list(map(int,input().split()))
print((a-b)*((-1)**K))

Solution (Python):
A, B, C, K = map(int, input().split())
print((A-B)*(-1)**(K+2))

Solution (Python):
a,b,c,k = map(int,input().split())
if k%2 == 0 and a-b <= 10**18:
    print(a-b)
elif k%2 != 0 and a-b <= 10**18:
    print(b-a)
"""
else:
    print("Unfair")
"""

Solution (Python):
a,b,c,k = map(int,input().split())
if k%2 == 0 and a-b <= 10**18:
    print(a-b)
elif k%2 != 0 and a-b <= 10**18:
    print(b-a)
else:
    print("Unfair")

Solution (Python):
A, B, C, K = map(int, input().split())
if K % 2 == 0:
    r = A - B
else:
    r = B - A
print(r if r <= 10**18 else "Unfair")

Solution (Python):
A, B, C, K = map(int, input().split())

ans = A-B if K % 2 == 0 else B-A

print(ans)

Solution (Python):
a,b,c,k=map(int,input().split())
num=a-b
if k%2==1:
    print((-1)*num)
else:
    print(num)

Solution (Python):
A, B, C, K = map(int, input().split())
if K % 2 == 0:
    ans = A-B
else:
    ans = B-A
if ans > 10**18:
    ans = "Unfair"
print(ans)

Solution (Python):
A, B, C, K = list(map(int, input().split()))

if K%2 == 0:
  if A-B > 10**18:
    print("Unfair")
  else:
    print(A-B)
else:
  if -(A-B) > 10**18:
    print("Unfair")
  else:
    print (-(A-B))

Solution (Python):
a, b, c, k = map(int, input().split())
if k % 2 == 0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b, c, k = inintm()

print(a-b) if k % 2 == 0 else print(b-a)

Solution (Python):
def main():
    A, B, C, K = map(int, input().split())

    d = abs(A - B)
    if d > 10**18:
        print("Unfair")

    else:
        if A > B:
            if K % 2 == 0:
                print(d)
            else:
                print(-d)

        elif A < B:
            if K % 2 == 0:
                print(-d)
            else:
                print(d)

        else:
            print("0")

if __name__ == "__main__":
    main()

Solution (Python):
a,b,c,k = list(map(int, input().strip().split()))
if ((-1)**(k-1))*(a-b)<=10**18:
    print(((-1)**((k)%2))*(a-b))
else:
    print("Unfair")

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    a, b, c, k = map(int, input().split())
    if k & 1:
        print(b-a)
    else:
        print(a-b)


if __name__ == '__main__':
    main()

Solution (Python):
import math
import sys
import collections
import bisect


def main():
    a, b, c, k = map(int, input().split())
    print((-1) ** k * (a - b))


if __name__ == '__main__':
    main()

Solution (Python):
A, B, C, K = map(int, input().split())




if K % 2 == 0:
    print(A - B)
else:
    print(B - A)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

A, B, C, K = map(int, input().split())

if K % 2 == 0:
    ans = A - B
else:
    ans = B - A

print(ans)

Solution (Python):
A,B,C,K = map(int,input().split())
s1 = 0
s2 = 0
for i in range(2):
    a = A + 2 * B
    b = B + 2 * A
    A = a
    B = b
    if i == 0:
        s1 = A - B
    else:
        s2 = A - B
if K % 2 == 1:
    if s1 < 10 ** 18:
        print(s1)
    else:
        print("Unfair")
else:
    if s2 < 10 ** 18:
        print(s2)
    else:
        print("Unfair")

Solution (Python):
a,b,c,k = map(int,input().split())

x = abs(a-b)
if x > 10**18:
    print('Unfair')
else:
    if k % 2 == 0:
        print(a - b)
    else:
        print(b-a)

Solution (Python):
a,b,c,k=map(int,input().split())
inf=10**18+1

if k%2==0:
    ans=a-b
else:
    ans=b-a

if ans<inf:
    print(ans)
else:
    print('Unfair')

Solution (Python):
A,B,C,K = map(int,input().split())
ans = (B - A) * (-1 if K % 2 == 0 else 1)
if ans > 10 ** 18:
    print("Unfair")
else:
    print(ans)

Solution (Python):
A, B, C, K = map(int,input().split())
ans = A - B
if abs(ans) > 10 ** 18:
    print('Unfair')
elif K % 2 == 1:
    ans *= -1
    print(ans)
else:
    print(ans)

Solution (Python):
A,B,C,K = map(int,input().split())
for i in range(K%2):
    A,B,C = B+C,C+A,A+B
print(A-B)

Solution (Python):
A, B, C, K = map(int, input().split())
ans = B - A if K % 2 == 1 else A - B
print(ans if abs(ans) <= 10 ** 18 else "Unfair")

Solution (Python):
A, B, C, K = map(int,input().split())
if K == 0 or K % 2 ==0:
  ans = A-B
else:
  ans = -(A-B)
if abs(ans) > 10**18:
  print("Unfair")
else:
  print(ans)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

a,b,c,k = map(int,readline().split())
if even(k):
    print(a-b)
else:
    print(b-a)

Solution (Python):
A,B,C,K = map(int,input().split())
if K % 2 == 0:
  print(A-B)
else:
  print(B-A)

Solution (Python):


A,B,C,K = [int(x) for x in input().split(" ")]

if K % 2 == 0:
    ans = A - B
else:
    ans = B - A

print(ans)

Solution (Python):
A,B,C,K = map(int,input().split())
S = A + B + C
S += S * K

if K % 2 == 0:
  
  S -= (B-A) + (C-A)
  a = S // 3
  b = a + (B-A)
  ans = a - b
else:
  
  S -= (A-B) + (A-C)
  a = S // 3
  b = a + (A-B)
  ans = a - b
  
if abs(ans) > 10 ** 18:
  print("Unfair")
  exit()
  
print(ans)

Solution (Python):
A, B, C, K = input().split(' ')
A = int(A)
B = int(B)
C = int(C)
K = int(K)
if K%2==0:
  print(A-B)
else:
  print(B-A)

Solution (Python):
a,b,c,k=map(int,input().split())

lim=10**18
if k%2==0:
    print(a-b if a-b<=lim else "unfair")
elif k%2==1:
    print(b-a if b-a<=lim else "unfair")

Solution (Python):
A,B,C,K = map(int, input().split())














ans = A - B
if K%2==0:
  print(ans)
else:
  print(-ans)

Solution (Python):
a,b,c,k = map(int,input().split())

if k % 2 == 0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
A,B,C,K = [int(i) for i in input().split()]



print(B - A if K&1 else A - B)

Solution (Python):
a,b,c,k=map(int,input().split())
ans=(-1)**k*(a-b)
print(['Unfair',ans][int(abs(ans)<10**18)])

Solution (Python):
a,b,c,k = map(int,input().split())
if abs(a - b) > 10**18:
    print("unfair")
    exit()
if k % 2 == 0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
a, b, c, k = map(int, input().split())
ans = 0
if k % 2 == 0:
  ans = a - b
else:
  ans = b - a
print(ans)

Solution (Python):
a, b, c, k = map(int, input().split())

if k % 2 == 0:
    print(a - b if abs(a - b) < 10 ** 18 else 'Unfair')
else:
    print(b - a if abs(b - a) < 10 ** 18 else 'Unfair')

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b, c, k = map(int, readline().split())
    if k % 2 == 0:
        diff = a - b
    else:
        diff = b - a

    if abs(diff) > 10 ** 18:
        print("Unfair")
    else:
        print(diff)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
a, b, c, k = map(int, input().split())

if abs(b-a) >= 10**18: print('Unfair')
elif k%2 == 1: print(b-a)
else: print(a-b)

Solution (Python):
a,b,c,k = map(int,input().split())

lim = 10**18
_a = b+c
_b = a+c
if lim < _a-_b:
    print('Unfair')
elif k%2==0:
    print((_a-_b)*-1)
else:
    print(_a-_b)

Solution (Python):
import sys
input = sys.stdin.readline
enum = enumerate

def linput(ty=int, cvt=list):
	return cvt(map(ty,input().split()))

def vinput(rep=1, ty=int, cvt=list):
	return cvt(ty(input().rstrip()) for _ in "*"*rep)

def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a

def lcm(a: int, b: int):
	return a * b // gcd(a, b)

def main():
	a,b,c,k = linput()
	d = a-b
	res = 0

	
	
	
	
	
	
	res = d*(-1)**(k%2)
	
	
	print(res)

if __name__ == "__main__":
	main()

Solution (Python):
a, b, c, k = map(int, input().split())
ans = a - b
if abs(ans) > 1e18 :
    print("Unfair")
elif k % 2 == 0 :
    print(ans)
else :
    print(-ans)

Solution (Python):
A, B, C, K = map(int, input().split())
if K % 2 == 0:
    print(A-B)
else:
    print(B-A)

Solution (Python):
a,b,c,k = map(int,input().split())
print(a-b if ~k&1 else b-a)

Solution (Python):
A,B, C, K = map(int,input().split())
if K%2==0:
  print(A-B)
else:
  print(B-A)

Solution (Python):
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

A, B, C, K = ri_()
print(A - B if K % 2 == 0 else B - A)

Solution (Python):
MAX_N = 1_000_000_000_000_000_000
A, B, C, K = list(map(int, input().split()))
res = A - B if K % 2 == 0 else B - A
if abs(res) >= MAX_N:
    print('Unfair')
else:
    print(res)

Solution (Python):
a,b,c,k=map(int,input().split())
abc=a+b+c
k2=k%2
if k2==0:
  ans=a-b
else:
  ans=b-a
print(ans)

Solution (Python):
a,b,c,k = map(int, open(0).read().split())

fact = 1
if k%2:
    fact = -1
print((a-b)*fact)

Solution (Python):
a,b,c,k=map(int,input().split())
if abs(a-b)<10**18:
    if k%2==0:
        print(a-b)
    else:
        print(b-a)
else:
    print("Unfair")

Solution (Python):

a, b, c, k = map(int, input().split())
if abs(a - b) > 10**18:
    print("Unfair")
else:
    print((a - b) * (-1)**k)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

A, B, C, K = mapint()
if K%2==0:
    print(A-B)
else:
    print(B-A)

Solution (Python):
a,b,c,k = map(int,input().split())
if k%2 == 0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
a,b,c,k=map(int,input().split())
if k%2==0:
  print(a-b)
else:
  print(b-a)

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a,b,c,k=nii()
if k%2==0:
  print(a-b)
else:
  print(b-a)

Solution (Python):
def resolve():
  a, b, c, k = map(int, input().split())
  if k % 2 == 0:
    print(a-b)
  else:
    print(b-a)
  return

if __name__ == "__main__":
  resolve()

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

A,B,C,K = I()
if K%2 == 0:
    num = A-B
else:
    num = B-A
if abs(num) > 10**18:
    print('Unfair')
else:
    print(num)

Solution (Python):
A,B,C,K = map(int,input().split())

S = A+B+C
d = A-B

if d > pow(10,18):
  print("unfair")
  exit()
if K%2 == 0:
  print(d)
else:
  print(-d)

Solution (Python):
A,B,C,K = map(int,input().split())
if K%2==0:
    print(A-B)
else:
    print(B-A)

Solution (Python):
A,B,C,K = map(int,input().split())
if K%2:
    print(B-A)
else:
    print(A-B)

Solution (Python):
A,B,C,K = map(int,input().split())
x = A-B

ans = x * ((-1)**K)
print(ans)

Solution (Python):
a, b, c, k = map(int, input().split())

if len(str(abs(a-b))) > 18:
    ans = 'Unfair'
else:
    ans = (a-b) * (-1)**(k%2)

print(ans)

Solution (Python):
A, B, C, K = map(int, input().split())

res = (-1) ** K * (A - B)

    

    
print(res)

Solution (Python):
A, B, C, K = map(int, input().split())
threshold = 10 ** 18
res = (-1) ** K * (A - B)
if abs(res) > threshold:
    print('Unfair')
else:
    print(res)

Solution (Python):
A,B,C,K = map(int,input().split())

if abs(B-A) > 10**18:
  print('Unfair')
else:
  if K % 2 == 0:
    print(A-B)
  else:
    print(B-A)

Solution (Python):
def resolve():
    a, b, c, k = map(int, input().split())
    if k % 2 == 0:
        print(a-b)
    else:
        print(b-a)
resolve()

Solution (Python):
a, b, c, k = map(int, input().split())
is_odd = k % 2
if is_odd == 0:
    ans = a - b
else:
    ans = b - a
if ans > 10 ** 18:
    print("Unfair")
else:
    print(ans)

Solution (Python):
A,B,C,K=map(int,input().split())
print(A-B if K%2==0 else B-A)

Solution (Python):
A,B,C,K=map(int,input().split())

if K%2==1:
    ans=B-A
else:
    ans=A-B

print(ans)

Solution (Python):
a,b,c,k=map(int,input().split())
x=a-b
if k%2==0:
  print(x)
else:
  print(x*(-1))

Solution (Python):
a, b, c, k = [int(w) for w in input().split()]

print(a - b if k % 2 == 0 else b - a)

Solution (Python):
A,B,C,K=map(int,input().split())

if abs(A-B)>10**18:
    print("Unfair")
else:
    print((A-B)*(-1)**K)

Solution (Python):
A, B, C, K = [int(_) for _ in input().split()]

if abs(A - B) > 10 ** 18:
    print("Unfair")
else:
    if K % 2 == 0:
        print(A - B)
    else:
        print(B - A)

Solution (Python):
import sys
input = sys.stdin.readline


def read():
    A, B, C, K = map(int, input().strip().split())
    return A, B, C, K


def swap(a, b, c):
    return b+c, c+a, a+b


def solve(A, B, C, K):
    a, b, c = A, B, C
    s = (A + B + C) * (K // 2)
    a += s
    b += s
    c += s
    if K % 2 == 1:
        a, b, c = swap(a, b, c)
    return a - b


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))

Solution (Python):
a, b, c, k = map(int, input().split())
if k % 2 == 0 :
    ans = a - b
else:
    ans = b - a
if ans > 10 ** 18:
    print('Unfair')
else:
    print(ans)

Solution (Python):
a, b, c, k = map(int,input().split())
 
if k % 2 == 0:
    ans = a - b
else:
    ans = b - a
 
print(ans)

Solution (Python):
a,b,c,k = map(int,input().split())
i = 0
if  k % 2 == 0:
  print(a-b)
else :
  print(b-a)

Solution (Python):
A, B, C, K = map(int, input().split())
if abs(A - B) > 10 ** 18:
    print("Unfair")
elif K % 2 == 0:
    print(A-B)
else:
    print(B-A)

Solution (Python):









import sys
input = sys.stdin.readline

A, B, C, K = map(int, input().split())

if abs(A - B) > 10 ** 18:
    print("Unfair")
elif K % 2 == 0:
    print(A-B)
else:
    print(B-A)

Solution (Python):
A,B,C,K = map(int,input().split())

if K%2==0:
  print(A-B)
  
else:
  print(-A+B)

Solution (Python):
a,b,c,k = map(int,input().split())

if k % 2 == 0:
    print(a-b)
else:
    print(b-a)

Solution (Python):
a,b,c,k=map(int,input().split())
if k%2==0:
    print(a-b)
else:
    print(b-a)

Solution (Python):











A,B,C,K= map(int,input().split())



if K%2==0:
    ans = A-B
else:
    ans = B-A
    
if ans>10**18:
    print('Unfair')
else:
    print(ans)

Solution (Python):
a, b, _, k = map(int, input().split())
print(b - a if k & 1 else a - b)

Solution (Python):
a, b, _, k = map(int, input().split())
print((a - b)*((-1)**(k & 1)))

Solution (Python):
a, b, _, k = map(int, input().split())
print((a - b)*((-1)**(k % 2)))

Solution (Python):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b,c,k = i2()
if k%2 == 0:
	print(a - b)
else:
	print(b - a)

Solution (Python):
A,B,C,K=map(int,input().split())
if K%2==0:
    ans=A-B
else:
    ans=B-A
if ans>1000000000000000000:
    ans="Unfair"
print(ans)

Solution (Python):
A, B, C, K = map(int, input().split())

ans = A - B
if abs(ans) <= 10 ** 18:
    if K % 2 == 0:
        print(ans)
    else:
        print(ans * -1)
else:
    print("Unfair")

Solution (Python):
A,B,C,K = map(int, input().split())
print(A-B if K%2 == 0 else B-A)

Solution (Python):
a,b,c,k = map(int,input().split())
i = 0
if  k % 2 == 0:
  print(a-b)
else :
  print(b-a)

Solution (Python):
a, b, c, k = map(int, input().split())
if k % 2 == 0:
  print(a - b)
else:
  print(b - a)

Solution (Python):
def resolve():
    a, b, c, k = [int(i) for i in input().split()]
    if k % 2 == 0:
        print(a - b)
    else:
        print((a - b) * -1)


resolve()

Solution (Python):
a,b,c,k=map(int,input().split())
if k%2==0:
  print(a-b)
else:
  print(b-a)

Solution (Python):
A,B,C,K = map(int,input().split())

if K % 2 == 0:
    m = A-B
else:
    m = B-A

print(m)

Solution (Python):
A, B, C, K = map(int, input().split())
if K%2 == 0:
    print(A-B)
else:
    print(B-A)

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    A,B,C,K = map(int,input().split())
    if K%2 == 0:
        ans = A - B
    else:
        ans = B - A
    if abs(ans) > 1000000000000000000:
        ans = 'Unfair'
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
a,b,c,k=map(int,input().split())

if k%2 == 0 and abs(a-b)<=10**18:print(a-b)
elif k%2 != 0 and abs(b-a)<=10**18:print(b-a)
else:print("Unfair")

Solution (Python):
a,b,c,k = map(int,input().split())

if k %2 == 0:
  print(a-b)
else:
  print(b-a)

Solution (Python):
A,B,C,K = map(int,input().split())
ans = A-B
if abs(ans) > 10**18:
  ans = 'Unfair'
else:
  if K%2 != 0:
    ans = B-A
print(ans)

Solution (Python):
a, b, c, k = map(int, input().split())
print((a-b)*(-1)**k)

Solution (Python):
a,b,c,k = map(int, input().split())

ans = a - b

if(k % 2 == 1):
    ans = b - a

print(ans)