p, q = map(int, input().split()) n = int(input()) if((p+q)%2==1): print(n)