#include <bits/stdc++.h>
using namespace std;
unsigned int N, P, Q;
unsigned int gcd(unsigned int a, unsigned int b) {
  return b ? gcd(b, a % b) : a;
}
vector<unsigned int> a, b;
unsigned int calc(unsigned int i) {
  a.clear(), b.clear();
  for (unsigned int j = 1; j <= i; j++) a.push_back(N - j + 1), b.push_back(j);
  for (unsigned int j = 0; j < i; j++)
    for (unsigned int k = 0; k < i; k++) {
      unsigned int d = gcd(a[j], b[k]);
      a[j] /= d, b[k] /= d;
    }
  unsigned int ans = 1;
  for (unsigned int j = 0; j < i; j++) ans *= a[j];
  return ans;
}
unsigned int C[133];
int main() {
  scanf("%d%d%d", &N, &P, &Q);
  P = min(P, N - 1);
  for (unsigned int i = 0; i <= P; i++) C[i] = calc(i);
  unsigned int ans = 0;
  for (unsigned int i = 1; i <= Q; i++) {
    unsigned int powi = 1, Ri = 0;
    for (unsigned int j = 0; j <= P; j++) powi *= i, Ri += C[j] * powi;
    ans ^= Ri;
  }
  printf("%u", ans);
}
