#include <bits/stdc++.h>
using namespace std;
void fenjie(unsigned int x, map<unsigned int, unsigned int> &mp) {
  for (unsigned int i = 2; 1ll * i * i <= x; i++) {
    while (x % i == 0) {
      mp[i] += 1;
      x /= i;
    }
  }
  if (x != 1) mp[x] += 1;
}
unsigned int ksm(unsigned int a, unsigned int b) {
  unsigned int jg = 1;
  while (b > 0) {
    if (b & 1) jg *= a;
    a *= a;
    b = (b >> 1);
  }
  return jg;
}
unsigned int cal(map<unsigned int, unsigned int> &mz,
                 map<unsigned int, unsigned int> &mm) {
  unsigned int ans = 1;
  for (map<unsigned int, unsigned int>::iterator it = mz.begin();
       it != mz.end(); it++)
    ans *= ksm(it->first, it->second - mm[it->first]);
  return ans;
}
map<unsigned int, unsigned int> mz[132], mm[132];
unsigned int C[132], mi[2000010], R[2000010];
signed main() {
  unsigned int n, p, q;
  scanf("%d%d%d", &n, &p, &q);
  if (n - 1 < p) p = n - 1;
  for (unsigned int i = 1; i <= p; i++) {
    mm[i] = mm[i - 1];
    fenjie(i, mm[i]);
  }
  for (unsigned int i = n; i >= n - p + 1; i--) {
    if (i < n) mz[n - i] = mz[n - (i + 1)];
    fenjie(i, mz[n - i]);
  }
  C[0] = 1;
  for (unsigned int i = 1; i <= p; i++) C[i] = cal(mz[i - 1], mm[i]);
  for (unsigned int i = 1; i <= q; i++) mi[i] = 1;
  for (unsigned int i = 0; i <= p; i++) {
    for (unsigned int j = 1; j <= q; j++) {
      R[j] += C[i] * mi[j];
      mi[j] *= j;
    }
  }
  unsigned int ans = 0;
  for (unsigned int i = 1; i <= q; i++) ans ^= R[i] * i;
  printf("%u", ans);
  return 0;
}
