#include <bits/stdc++.h>
using namespace std;
int n, p, q;
unsigned int a[1005];
unsigned int fpow(unsigned int x, unsigned int y) {
  unsigned int ans = 1;
  while (y) {
    if (y & 1) ans *= x;
    x *= x;
    y /= 2;
  }
  return ans;
}
inline int lowbit(int x) { return x & -x; }
int F(int x) {
  int ct = 0;
  while (x % 2 == 0) x /= 2, ct++;
  return ct;
}
int main() {
  scanf("%d%d%d", &n, &p, &q);
  p = min(p, n - 1);
  unsigned int nw = 1, nw2 = 1;
  int ct = 0;
  a[0] = 1;
  for (int i = 1; i <= p; i++) {
    nw *= (n - i + 1) / lowbit(n - i + 1);
    nw2 *= i / lowbit(i);
    ct += F(n - i + 1);
    ct -= F(i);
    a[i] = (nw * fpow(nw2, (1u << 31u) - 1)) << ct;
  }
  unsigned int ans = 0;
  for (int i = 1; i <= q; i++) {
    unsigned int nans = 0;
    for (int j = p; j >= 0; j--) nans = nans * i + a[j];
    ans ^= (nans * i);
  }
  printf("%u\n", ans);
  return 0;
}
