#include using namespace std; int main(){ vector f(2); long long int n; for(auto &a:f) cin >> a; cin >> n; long long int tmp; for(int i = 2; i <= n; i++){ tmp = f[i - 1] ^ f[i - 2]; f.push_back(tmp); } // for(auto a:f) cout << a << endl; cout << f[n] << endl; return 0; }