#include <bits/stdc++.h>
using namespace std;
const int RLEN = 1 << 20 | 1;
inline char gc() {
  static char ibuf[RLEN], *ib, *ob;
  (ib == ob) && (ob = (ib = ibuf) + fread(ibuf, 1, RLEN, stdin));
  return (ib == ob) ? EOF : *ib++;
}
inline int read() {
  char ch = gc();
  int res = 0;
  bool f = 1;
  while (!isdigit(ch)) f ^= ch == '-', ch = gc();
  while (isdigit(ch)) res = (res + (res << 2) << 1) + (ch ^ 48), ch = gc();
  return f ? res : -res;
}
inline long long readll() {
  char ch = gc();
  long long res = 0;
  bool f = 1;
  while (!isdigit(ch)) f ^= ch == '-', ch = gc();
  while (isdigit(ch)) res = (res + (res << 2) << 1) + (ch ^ 48), ch = gc();
  return f ? res : -res;
}
inline int readstring(char *s) {
  int top = 0;
  char ch = gc();
  while (isspace(ch)) ch = gc();
  while (!isspace(ch) && ch != EOF) s[++top] = ch, ch = gc();
  s[top + 1] = '\0';
  return top;
}
template <typename tp>
inline void chemx(tp &a, tp b) {
  a = max(a, b);
}
template <typename tp>
inline void chemn(tp &a, tp b) {
  a = min(a, b);
}
const int N = 150;
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline unsigned int calc(int u, int p) {
  vector<int> up, dn;
  for (int i = 0; i < p; i++) up.push_back(u - i), dn.push_back(i + 1);
  for (int &a : up)
    for (int &b : dn) {
      int g = gcd(a, b);
      a /= g, b /= g;
    }
  unsigned int res = 1;
  for (int x : up) res = res * (unsigned int)x;
  return res;
}
unsigned int c[N];
int n, p, q;
int main() {
  n = read(), p = min(read(), n - 1), q = read();
  for (int i = 0; i <= p; i++) c[i] = calc(n, i);
  unsigned int ans = 0;
  for (int i = 1; i <= q; i++) {
    unsigned int res = 0, mt = 1;
    for (int j = 0; j <= p; j++)
      res = res + c[j] * mt, mt = mt * (unsigned int)i;
    ans ^= res * (unsigned int)i;
  }
  cout << ans << '\n';
  return 0;
}
