let xorFib n f0 f1 = let rec f n ``f_n-2`` ``f_n-1`` = match n with | 0L -> ``f_n-2`` | _ -> f (n-1L) ``f_n-1`` (``f_n-2``^^^``f_n-1``) f n f0 f1 let f0, f1, n = let t = stdin.ReadLine().Split() |> Array.map int64 t.[0], t.[1], t.[2] xorFib (n%3L) f0 f1 |> stdout.WriteLine