// No.64 XORフィボナッチ数列 // https://yukicoder.me/problems/no/64 // #include #include using namespace std; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); unsigned long F0, F1, N; cin >> F0 >> F1 >> N; vector fibo {F0, F1, F0^F1}; cout << fibo[N%3] << endl; }