import sequtils, strutils let a: seq[int] = stdin.readline.split.map(parseInt) f: array[3, int] = [a[0], a[1], a[0] xor a[1]] ans: int = f[a[2] mod 3] echo ans