#include <bits/stdc++.h>
using namespace std;
unsigned int n, p, q, ans;
inline vector<unsigned int> Mult(vector<unsigned int> A,
                                 vector<unsigned int> B) {
  vector<unsigned int> ret(A.size() + B.size() - 1);
  for (unsigned int i = 0; i < A.size(); i++) {
    for (unsigned int j = 0; j < B.size(); j++) {
      ret[i + j] += A[i] * B[j];
    }
  }
  return ret;
}
int main() {
  scanf("%u%u%u", &n, &p, &q);
  unsigned int N = n;
  vector<unsigned int> A(p + 1), B(p + 1);
  A[0] = 1;
  B[0] = B[1] = 1;
  while (n) {
    if (n & 1) A = Mult(A, B), A.resize(p + 1);
    B = Mult(B, B), B.resize(p + 1);
    n >>= 1;
  }
  unsigned int ans = 0;
  for (unsigned int i = 1; i <= q; i++) {
    unsigned int cur = 0;
    for (unsigned int j = 0, pw = 1; j <= p && j < N; j++, pw = pw * i)
      cur += A[j] * pw;
    ans ^= i * cur;
  }
  printf("%u\n", ans);
  return 0;
}
