#include <bits/stdc++.h>
using namespace std;
const int mx = 2e6 + 5, mxp = 150;
const long long mod = 1LL << 32;
long long n, p, q;
long long ans, t1, t2, c[mxp], poww;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long cal(int a) {
  if (a == 0) return 1;
  vector<long long> second, M;
  for (int i = 1; i <= a; i++) M.push_back(i);
  for (int i = n; i >= n - a + 1; i--) second.push_back(i);
  for (int i = 0; i < M.size(); i++) {
    for (int j = 0; j < second.size(); j++) {
      if (M[i] == 1) break;
      int tmp = gcd(M[i], second[j]);
      M[i] /= tmp;
      second[j] /= tmp;
    }
  }
  long long tmp = 1;
  for (auto v : second) tmp = (tmp * v) % mod;
  return tmp;
}
int main() {
  cin >> n >> p >> q;
  p = min(n - 1, p);
  for (int i = 0; i <= p; i++) c[i] = cal(i);
  for (int i = 0; i <= p; i++) ans = (ans + c[i]) % mod;
  unsigned long long tmp = 0;
  for (int i = 2; i <= q; i++) {
    tmp = 0;
    poww = 1;
    for (int j = 0; j <= p; j++) {
      tmp = (tmp + 1ll * c[j] * poww) % mod;
      poww = (poww * i) % mod;
    }
    tmp = (i * tmp) % mod;
    ans = ans ^ tmp;
  }
  return cout << ans, 0;
}
