#include <bits/stdc++.h>
using namespace std;
const unsigned long long mod = (1LL << 32);
int n, p, q;
int a[135], b[135];
unsigned long long c[135], ans;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
unsigned long long ksm(unsigned long long x, int y) {
  unsigned long long sum = 1;
  while (y) {
    if (y & 1) sum = sum * x % mod;
    y >>= 1;
    x = x * x % mod;
  }
  return sum;
}
int main() {
  cin >> n >> p >> q;
  p = min(p, n - 1);
  c[0] = 1;
  for (int k = 1; k <= p; k++) {
    c[k] = 1;
    for (int i = 1; i <= k; i++) a[i] = n - i + 1, b[i] = i;
    for (int i = 1; i <= k; i++) {
      for (int j = 2; j <= k; j++) {
        int tp = gcd(a[i], b[j]);
        if (tp != 1) a[i] /= tp, b[j] /= tp;
      }
    }
    for (int i = 1; i <= k; i++) c[k] = c[k] * a[i] % mod;
  }
  for (int i = 1; i <= q; i++) {
    unsigned long long tmp = 0;
    for (int j = 0; j <= p; j++) tmp = (tmp + (c[j] * ksm(i, j) % mod)) % mod;
    ans = ans ^ (tmp * i % mod);
  }
  cout << ans;
}
