using System; using System.Text; using System.Collections.Generic; using System.Linq; class Program { static void Main() { long[] n = Console.ReadLine().Split().Select(a => long.Parse(a)).ToArray(); long l = n[2] + 1; if(l < 2) l = 2; long[] list = new long[l]; list[0] = n[0]; list[1] = n[1]; for(long i = 2; i < l; i++) { list[i] = list[i - 2] ^ list[i - 1]; } Console.WriteLine($"{list[n[2]]}"); } }