#include <bits/stdc++.h>
using namespace std;
const unsigned N = 2e6 + 5, P = 135;
unsigned n, p, q;
unsigned c[P], a[P], b[P];
unsigned gcd(unsigned x, unsigned y) { return !y ? x : gcd(y, x % y); }
signed main() {
  cin >> n >> p >> q;
  p = min(p, n - 1);
  for (unsigned i = (0); i <= (p); ++i) {
    for (unsigned j = (1); j <= (i); ++j) a[j] = j, b[j] = n + 1 - j;
    for (unsigned j = (1); j <= (i); ++j)
      for (unsigned k = (1); k <= (i); ++k)
        if (a[k] != 1) {
          unsigned d = gcd(b[j], a[k]);
          a[k] /= d, b[j] /= d;
        }
    c[i] = 1;
    for (unsigned j = (1); j <= (i); ++j) c[i] = c[i] * b[j];
  }
  unsigned out = 0;
  for (unsigned i = (1); i <= (q); ++i) {
    unsigned res = 0, tmp = 1;
    for (unsigned j = (0); j <= (p); ++j) {
      res += tmp * c[j];
      tmp = tmp * i;
    }
    out ^= res * i;
  }
  cout << out << endl;
  return 0;
}
