#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    ;
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
  return x;
}
unsigned qpow(unsigned x, unsigned y = (1U << 31) - 1) {
  unsigned res = 1;
  for (; y; y >>= 1, x *= x)
    if (y & 1) res *= x;
  return res;
}
int n, p, q;
unsigned C[150];
int main() {
  n = read(), p = read(), q = read();
  p = min(p, n - 1);
  for (int i = 0; i <= p; i++) {
    int tot2 = 0;
    unsigned A = 1, B = 1;
    for (int j = 0; j < i; j++) {
      unsigned x = n - j;
      while (!(x & 1)) tot2++, x >>= 1;
      A *= x;
    }
    for (int j = 1; j <= i; j++) {
      unsigned x = j;
      while (!(x & 1)) tot2--, x >>= 1;
      B *= x;
    }
    if (tot2 >= 32)
      C[i] = 0;
    else
      C[i] = A * qpow(B) << tot2;
  }
  unsigned ans = 0;
  for (int i = 1; i <= q; i++) {
    unsigned S = 1, subans = 0;
    for (int j = 0; j <= p; j++) {
      subans += C[j] * S;
      S *= i;
    }
    ans ^= i * subans;
  }
  printf("%u\n", ans);
  return 0;
}
