#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
unsigned int c[maxn], w[maxn];
unsigned int gcd(unsigned int a, unsigned int b) {
  return b ? gcd(b, a % b) : a;
}
unsigned int ans, n, p, q;
int main() {
  scanf("%u%u%u", &n, &p, &q);
  for (unsigned int i = 0; i <= min(n - 1, p); i++) {
    for (unsigned int j = 1; j <= i; j++) w[j] = n - j + 1;
    for (unsigned int j = 1; j <= i; j++) {
      int t = j;
      for (unsigned int k = i; k >= 1; k--) {
        unsigned int g = gcd(w[k], t);
        t /= g, w[k] /= g;
      }
    }
    c[i] = 1;
    for (int j = 1; j <= i; j++) c[i] = c[i] * w[j];
  }
  for (int i = 1; i <= q; i++) {
    unsigned int res = 0;
    for (unsigned int j = 0, t = 1; j <= min(n - 1, p); j++)
      res += c[j] * t, t *= i;
    ans ^= res * i;
  }
  printf("%u\n", ans);
}
