import strutils, sequtils var xs = stdin.readLine.split.map(parseInt) let ys = [xs[0],xs[1],xs[0] xor xs[1]] echo ys[xs[2] mod 3]