#include <bits/stdc++.h>
using namespace std;
const int max_p = 150;
const unsigned long long mod = 1LL * 256 * 256 * 256 * 256;
unsigned long long pre[max_p];
unsigned long long pw(unsigned long long a, unsigned long long b) {
  if (b == 0) return 1;
  unsigned long long c = pw(a, b / 2);
  c = (c * c) % mod;
  if (b % 2 == 1) c = (c * a) % mod;
  return c;
}
int main() {
  int n, p, q;
  cin >> n >> p >> q;
  p = min(n - 1, p);
  unsigned long long ans = 0;
  for (int i = 0; i <= p; i++) {
    int cnt = 0;
    unsigned long long z = 1;
    for (int j = 0; j < i; j++) {
      unsigned long long id = n - j;
      while (id % 2 == 0) {
        cnt++;
        id /= 2;
      }
      z = (z * id) % mod;
    }
    for (int j = 1; j <= i; j++) {
      unsigned long long id = j;
      while (id % 2 == 0) {
        cnt--;
        id /= 2;
      }
      z = (z * pw(id, (mod / 2) - 1)) % mod;
    }
    cnt = min(cnt, 32);
    z = (z * pw(2, cnt)) % mod;
    pre[i] = z;
  }
  for (int i = 1; i <= q; i++) {
    unsigned long long z = 0;
    unsigned long long power = i;
    for (int j = 0; j <= p; j++) {
      unsigned long long id = (pre[j] * power) % mod;
      power = (i * power) % mod;
      z = (z + id) % mod;
    }
    ans ^= z;
  }
  cout << ans << endl;
}
