#include <bits/stdc++.h>
using namespace std;
unsigned C[150];
int n, p, q;
void mul(unsigned a[], const unsigned b[]) {
  for (int i = p; i >= 0; i--) {
    unsigned t = 0;
    for (int j = 0; j <= i; j++) t += a[j] * b[i - j];
    a[i] = t;
  }
}
void calcbinom(int n) {
  unsigned ans[150], a[150];
  fill(ans, ans + p + 1, 0), ans[0] = 1;
  fill(a, a + p + 1, 0);
  a[0] = a[1] = 1;
  for (; n; n >>= 1, mul(a, a))
    if (n & 1) mul(ans, a);
  copy(ans, ans + p + 1, C);
}
int main() {
  scanf("%d%d%d", &n, &p, &q);
  p = min(p, n - 1);
  calcbinom(n);
  unsigned ans = 0;
  for (int i = 1; i <= q; i++) {
    unsigned pw = i;
    unsigned s = 0;
    for (int j = 0; j <= p; j++) s += C[j] * pw, pw *= i;
    ans ^= s;
  }
  cout << ans << endl;
}
