#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
inline void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int n, p, q;
int pri[32], cntp;
inline bool check(int n) {
  for (int i = 2; i * i <= n; ++i)
    if (n % i == 0) return 0;
  return 1;
}
int c[32];
unsigned int sum;
void insc(int v) {
  for (int i = 1; i <= cntp; ++i)
    while (v % pri[i] == 0) v /= pri[i], ++c[i];
}
void mul(unsigned int v) {
  for (int i = 1; i <= cntp; ++i)
    while (v % pri[i] == 0 && c[i]) v /= pri[i], --c[i];
  sum *= v;
}
unsigned int calc(int n, int k) {
  int i;
  sum = 1;
  for (i = 1; i <= cntp; ++i) c[i] = 0;
  for (i = 1; i <= k; ++i) insc(i);
  for (i = 1; i <= k; ++i) mul(n - i + 1);
  return sum;
}
unsigned int C[135];
int main() {
  int i, j;
  unsigned int ans = 0, ret, v;
  cin >> n >> p >> q;
  for (i = 2; i < n && i <= p; ++i)
    if (check(i)) pri[++cntp] = i;
  for (i = 0; i < n && i <= p; ++i) C[i] = calc(n, i);
  for (i = 1; i <= q; ++i) {
    ret = 0, v = 1;
    for (j = 0; j < n && j <= p; ++j, v *= i) ret += C[j] * v;
    ans ^= ret * (unsigned int)(i);
  }
  cout << ans << '\n';
  return 0;
}
