#include <bits/stdc++.h>
using namespace std;
int n, p, q;
unsigned int C[132];
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int a[132];
void Init() {
  C[0] = 1;
  for (int i = 1; i <= min(p, n - 1); ++i) {
    a[0] = 0;
    for (int j = 0; j < i; ++j) a[++a[0]] = n - j;
    for (int k = 1; k <= i; ++k) {
      int x = k;
      for (int j = 1; j <= a[0] && k != 1; ++j) {
        int Gcd = gcd(x, a[j]);
        a[j] /= Gcd, x /= Gcd;
      }
    }
    C[i] = 1;
    for (int j = 1; j <= a[0]; ++j) C[i] = C[i] * a[j];
  }
}
int main() {
  scanf("%d%d%d", &n, &p, &q), Init();
  unsigned int ans = 0;
  for (int i = 1; i <= q; ++i) {
    unsigned int tmp = 0, now = 1;
    for (int j = 0; j <= min(p, n - 1); ++j, now = now * i) tmp += C[j] * now;
    ans ^= tmp * i;
  }
  printf("%u\n", ans);
  return 0;
}
