#include <bits/stdc++.h>
using namespace std;
unsigned int qpow(unsigned int a,
                  unsigned int b = (((unsigned int)1) << 31) - 1) {
  unsigned int ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
const int maxn = 150;
unsigned int pre[maxn], pre2[maxn], suf[maxn], suf2[maxn];
unsigned int n, p, q;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> p >> q;
  p = min(p, n - 1);
  suf[0] = pre[0] = 1;
  for (int i = 1; i <= p; i++) {
    pre[i] = i;
    while (pre[i] % 2 == 0) pre[i] >>= 1, pre2[i]++;
    pre2[i] += pre2[i - 1];
    pre[i] = qpow(pre[i]);
    if (i - 1) pre[i] *= pre[i - 1];
    suf[i] = n - i + 1;
    while (suf[i] % 2 == 0) suf[i] >>= 1, suf2[i]++;
    suf2[i] += suf2[i - 1];
    if (i - 1) suf[i] *= suf[i - 1];
  }
  unsigned int Ans = 0, ans;
  for (int i = 1; i <= q; i++) {
    unsigned int pw = 1;
    ans = 0;
    for (int k = 0; k <= p; k++, pw = pw * (unsigned int)i) {
      if (suf2[k] - pre2[k] <= 32)
        ans += suf[k] * pre[k] * pw << (suf2[k] - pre2[k]);
    }
    Ans ^= (unsigned int)i * ans;
  }
  cout << Ans << "\n";
  return 0;
}
