#include <bits/stdc++.h>
using namespace std;
const unsigned int P = 130 + 10;
vector<unsigned int> vec;
unsigned int dp[P];
unsigned int n, p, q, cnt, ans;
unsigned int GCD(unsigned int a, unsigned int b) {
  return (b ? GCD(b, a % b) : a);
}
void choose(unsigned int k) {
  vec.clear();
  for (unsigned int i = n; i > n - k; i--) vec.push_back(i);
  for (unsigned int i = 1; i <= k; i++) {
    unsigned int j = i;
    for (auto &x : vec) {
      unsigned int gcd = GCD(x, j);
      x /= gcd;
      j /= gcd;
    }
  }
  dp[k] = 1;
  for (auto x : vec) dp[k] *= x;
}
int32_t main() {
  cin >> n >> p >> q;
  p = min(p, n - 1);
  for (unsigned int i = 0; i <= p; i++) choose(i);
  for (unsigned int i = 1; i <= q; i++) {
    unsigned int k = 1, cnt = 0;
    for (unsigned int j = 0; j <= p; j++) {
      cnt += dp[j] * k;
      k *= i;
    }
    cnt *= i;
    ans ^= cnt;
  }
  return cout << ans, 0;
}
