import sequtils,strutils var N,i : int F = newSeq[int](3) (F[0],F[1],N) = stdin.readline.split.map(parseInt) F[2] = (F[0] xor F[1]) i = N mod 3 echo F[i]