#include <bits/stdc++.h>
using namespace std;
unsigned n, p, q;
unsigned A[2000006];
unsigned gcd(unsigned a, unsigned b) { return b ? gcd(b, a % b) : a; }
unsigned C(unsigned a, unsigned b) {
  vector<unsigned> t;
  for (unsigned i = (1), iend = (b); i <= iend; ++i) t.push_back(a - i + 1);
  for (unsigned i = (1), iend = (b); i <= iend; ++i) {
    unsigned zjk = i;
    for (auto& x : t) {
      unsigned g = gcd(x, zjk);
      x /= g, zjk /= g;
      if (zjk == 1) break;
    }
  }
  unsigned res = 1;
  for (auto& x : t) res *= x;
  return res;
}
unsigned c[2000006];
unsigned Pow(unsigned x, unsigned a) {
  unsigned ret = 1;
  while (a) {
    if (a & 1) ret = ret * x;
    x = x * x, a >>= 1;
  }
}
void solve() {
  cin >> n >> p >> q;
  for (unsigned i = (0), iend = (min(n - 1, p)); i <= iend; ++i) c[i] = C(n, i);
  unsigned res = 0;
  for (unsigned i = (1), iend = (q); i <= iend; ++i) {
    unsigned re = 0, qw = 1;
    for (unsigned j = (0), jend = (min(n - 1, p)); j <= jend; ++j) {
      qw *= i;
      re += qw * c[j];
    }
    res ^= re;
  }
  cout << res << endl;
}
signed main() { solve(); }
