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(); if(n[2] == 0) { Console.WriteLine($"{n[0]}"); return; } if(n[2] == 1) { Console.WriteLine($"{n[1]}"); return; } long before2 = n[0]; long before1 = n[1]; long current = before2 ^ before1; for(long i = 2; i < n[2]; i++) { before2 = before1; before1 = current; current = before2 ^ before1; } Console.WriteLine($"{current}"); } }