#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
using namespace std;
inline unsigned int quickpow(unsigned int x, int k) {
  unsigned int res = 1;
  while (k) {
    if (k & 1) res = res * x;
    x = x * x;
    k >>= 1;
  }
  return res;
}
int n, p, q;
unsigned int C[158];
int pricnt[158];
unsigned int res;
inline void Divi(int x, int type) {
  for (int i = 2; i <= p; ++i) {
    if (x % i == 0) {
      while (x % i == 0) pricnt[i] += type, x /= i;
    }
  }
  res = res * x;
}
inline unsigned int get_c(int n, int k) {
  if (n < 0 || k < 0 || n - k < 0) return 0;
  res = 1;
  memset(pricnt, 0, sizeof(pricnt));
  for (int i = 0; i < k; ++i) Divi(n - i, 1);
  for (int i = 1; i <= k; ++i) Divi(i, -1);
  for (int i = 1; i <= p; ++i) res = res * quickpow(i, pricnt[i]);
  return res;
}
int main() {
  read(n), read(p), read(q);
  for (int i = 0; i <= p; ++i) C[i] = get_c(n, i);
  unsigned int ans = 0;
  for (int t = 1; t <= q; ++t) {
    unsigned int res = 0, tmp = 1;
    for (int j = 0; j <= p && j <= n - 1; ++j)
      res = res + C[j] * tmp, tmp = tmp * t;
    ans ^= res * t;
  }
  printf("%u\n", ans);
  return 0;
}
