#include <bits/stdc++.h>
using namespace std;
const int N = 137, M = 2e5 + 7;
unsigned int f[N][N];
int n, m, k, w[N];
struct matrix {
  unsigned int f[N][N];
} e, r, g[N];
struct vecter {
  unsigned int f[N];
} p, s[M];
unsigned int getans(int a, int b) {
  if (a < b) return 0;
  memset(w, 0, sizeof(w));
  unsigned int sum = 1;
  for (int i = a - b + 1; i <= a; i++) {
    int c = i;
    for (int x = 2; x <= b; x++)
      while (!(c % x)) c /= x, w[x]++;
    sum = sum * c;
  }
  for (int i = b; i >= 1; i--) {
    int c = i;
    for (int x = 2; x <= b; x++)
      while (!(c % x)) c /= x, w[x]--;
    while (w[i]) sum = sum * i, w[i]--;
  }
  return sum;
}
inline matrix mul(matrix a, matrix b) {
  matrix h = e;
  for (int i = 0; i <= m; i++)
    for (int j = i; j <= m; j++)
      for (int k = j; k <= m; k++)
        h.f[i][k] = h.f[i][k] + a.f[i][j] * b.f[j][k];
  return h;
}
inline vecter mulc(vecter a, matrix b) {
  vecter h = p;
  for (int i = 0; i <= m; i++)
    for (int j = i; j <= m; j++) h.f[j] = h.f[j] + a.f[i] * b.f[i][j];
  return h;
}
inline matrix pows(matrix u, int v) {
  matrix c;
  bool fl = 0;
  while (v > 0) {
    if (v & 1) {
      if (!fl)
        c = u, fl = 1;
      else
        c = mul(c, u);
    }
    u = mul(u, u), v = v >> 1;
  }
  return c;
}
inline unsigned int getopt(vecter a, matrix b) {
  unsigned int sum = 0;
  for (int i = 0; i <= m; i++) sum = sum + a.f[i] * b.f[i][m];
  return sum;
}
int main() {
  cin >> n >> m >> k;
  m = min(m, n - 1);
  unsigned int ans = 0;
  for (int i = 0; i <= m; i++) s[0].f[i] = 1;
  for (int i = 0; i <= m; i++)
    for (int j = i; j <= m; j++) g[1].f[i][j] = getans(n - (m - j), j - i);
  for (int i = 0; i <= m; i++) g[0].f[i][i] = 1, r.f[i][m] = 1;
  for (int i = 1; i <= 16900; i++) s[i] = mulc(s[i - 1], g[1]);
  g[1] = pows(g[1], 16900);
  for (int i = 2; i <= 130; i++) g[i] = mul(g[i - 1], g[1]);
  for (int i = 1; i <= k; i++) {
    unsigned int x = i;
    ans = ans ^ (x * getopt(s[i % 16900], g[i / 16900]));
  }
  cout << ans << endl;
}
