#include <bits/stdc++.h>
using namespace std;
const int max_p = 130 + 5;
unsigned int C[max_p];
int num[max_p];
int Gcd(int a, int b) { return b ? Gcd(b, a % b) : a; }
int main() {
  int n, p, q;
  scanf("%d%d%d", &n, &p, &q);
  p = min(p, n - 1);
  C[0] = 1;
  for (int i = 1; i <= p; ++i) {
    C[i] = 1, num[i] = n - i + 1;
    int now = i;
    for (int j = 1; j <= i; ++j) {
      int d = Gcd(num[j], now);
      if (d > 1) num[j] /= d, now /= d;
      C[i] *= num[j];
    }
  }
  unsigned int ans = 0;
  for (int i = 1; i <= q; ++i) {
    unsigned int R = 0, pro = 1;
    for (int j = 0; j <= p; ++j) {
      R += C[j] * pro;
      pro *= i;
    }
    ans ^= i * R;
  }
  printf("%u\n", ans);
  return 0;
}
