#include <bits/stdc++.h>
using namespace std;
const unsigned int N = 150;
unsigned int n, p, q, now[N], c[N], ans;
inline unsigned int read() {
  unsigned int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
unsigned int gcd(unsigned int a, unsigned int b) {
  return !b ? a : gcd(b, a % b);
}
signed main() {
  n = read();
  p = read();
  q = read();
  for (unsigned int i = 0; i <= min(p, n - 1); i++) {
    for (unsigned int j = 1; j <= i; j++) now[j] = n - j + 1;
    for (unsigned int j = 1; j <= i; j++) {
      unsigned int x = j;
      for (unsigned int k = i; k >= 1; k--) {
        unsigned int g = gcd(now[k], x);
        if (g != 1) {
          now[k] /= g;
          x /= g;
          if (x == 1) break;
        }
      }
    }
    c[i] = 1;
    for (unsigned int j = 1; j <= i; j++) c[i] = c[i] * now[j];
  }
  for (unsigned int i = 1; i <= q; i++) {
    unsigned int res = 0, em = 1;
    for (unsigned int j = 0; j <= min(p, n - 1); j++) {
      res += em * c[j];
      em = em * i;
    }
    ans ^= (res * i);
  }
  cout << ans << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
