#include <bits/stdc++.h>
int N, P, Q;
unsigned O, W[131];
int gcd(int x, int y) {
  int r;
  while (y) {
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}
unsigned C(int n, int m) {
  static int f[130];
  for (int i = 0; i < m; i++) f[i] = n - i;
  for (int i = 1; i <= m; i++) {
    int t = i;
    for (int j = 0; t > 1 && j < m; j++) {
      int g = gcd(t, f[j]);
      t /= g;
      f[j] /= g;
    }
  }
  unsigned O = 1;
  for (int i = 0; i < m; i++) O *= f[i];
  return O;
}
int main() {
  scanf("%d%d%d", &N, &P, &Q);
  P = std::min(P, N - 1);
  for (int i = 0; i <= P; i++) W[i] = C(N, i);
  for (int i = 1; i <= Q; i++) {
    unsigned T = 0, D = 1;
    for (int k = 0; k <= P; k++) {
      T += W[k] * D;
      D *= i;
    }
    O ^= T * i;
  }
  printf("%u\n", O);
  return 0;
}
