#include <bits/stdc++.h>
unsigned int const N = 135;
template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}
unsigned int n, p, q, ans[N], Ans;
unsigned int gcd(unsigned int a, unsigned int b) {
  return b ? gcd(b, a % b) : a;
}
inline unsigned int calc(unsigned int j) {
  std::vector<unsigned int> a, b;
  for (unsigned int i = 1; i <= j; i++) a.push_back(n + 1 - i), b.push_back(i);
  for (unsigned int &x : a)
    for (unsigned int &y : b) {
      unsigned int d = gcd(x, y);
      x /= d, y /= d;
    }
  unsigned int ans = 1;
  for (unsigned int x : a) ans *= x;
  return ans;
}
int main() {
  read(n), p = std::min(n - 1, read(p)), read(q);
  for (unsigned int i = 0; i <= p; ++i) ans[i] = calc(i);
  for (unsigned int i = 1; i <= q; ++i) {
    unsigned int tmp = 0;
    for (unsigned int j = 0, k = 1; j <= p; j++, k *= i) tmp += ans[j] * k;
    Ans ^= tmp * i;
  }
  printf("%u", Ans);
  return 0;
}
