#include <bits/stdc++.h>
unsigned f[256], g[256];
unsigned tmp[256];
int p;
void cgf() {
  for (int i = 0; i <= p; i++) {
    tmp[i] = 0;
  }
  for (int i = 0; i <= p; i++) {
    for (int j = 0; j <= p - i; j++) {
      tmp[i + j] += f[i] * g[j];
    }
  }
  for (int i = 0; i <= p; i++) {
    f[i] = tmp[i];
  }
}
void cgg() {
  for (int i = 0; i <= p; i++) {
    tmp[i] = 0;
  }
  for (int i = 0; i <= p; i++) {
    for (int j = 0; j <= p - i; j++) {
      tmp[i + j] += g[i] * g[j];
    }
  }
  for (int i = 0; i <= p; i++) {
    g[i] = tmp[i];
  }
}
int main() {
  int n, q;
  scanf("%d%d%d", &n, &p, &q);
  if (p >= n) {
    p = n - 1;
  }
  f[0] = 1;
  g[0] = 1;
  g[1] = 1;
  while (n) {
    if (n & 1) {
      cgf();
    }
    cgg();
    n >>= 1;
  }
  unsigned answer = 0;
  for (int i = 1; i <= q; i++) {
    unsigned ans = 0;
    for (int j = p; j >= 0; j--) {
      ans = ans * i + f[j];
    }
    answer ^= ans * i;
  }
  printf("%u\n", answer);
  return 0;
}
