#include <bits/stdc++.h>
const int P = 135;
int n, p, q, i, j, C[P], a[P], ans;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  scanf("%d%d%d", &n, &p, &q);
  if (n - 1 < p) p = n - 1;
  for (C[0] = 1, i = 1; i <= p; i++) {
    a[i] = n + 1 - i;
    int k = i;
    for (j = 1; k > 1 && j <= i; j++) {
      int gd = gcd(k, a[j]);
      k /= gd;
      a[j] /= gd;
    }
    for (C[i] = 1, j = 1; j <= i; j++) C[i] = C[i] * a[j];
  }
  for (i = 1; i <= q; i++) {
    int pw = 1, sum = 0;
    for (j = 0; j <= p; j++, pw *= i) sum += C[j] * pw;
    ans ^= sum * i;
  }
  printf("%u", ans);
}
