#include <bits/stdc++.h>
using namespace std;
const unsigned int N = 4e6 + 5;
const unsigned int MAX = 1024 * 16;
const unsigned int L = 135;
unsigned int n, m, x, y, p, q;
unsigned int dp[MAX + 10][L];
struct Mat {
  unsigned int A[L][L];
  void init(void) { memset(A, 0, sizeof(A)); }
  friend Mat operator*(Mat a, Mat b) {
    Mat c;
    c.init();
    for (unsigned int k = 0; k <= p; ++k) {
      for (unsigned int i = 0; i <= k; ++i) {
        for (unsigned int j = k; j <= p; ++j) {
          c.A[i][j] += a.A[i][k] * b.A[k][j];
        }
      }
    }
    return c;
  }
} All[N / MAX + 10], Base;
unsigned int CCC[L][L];
unsigned int gcd(unsigned int x, unsigned int y) {
  return (!y) ? x : gcd(y, x % y);
}
unsigned int C(unsigned int x, unsigned int y) {
  vector<unsigned int> A;
  A.clear();
  for (unsigned int i = 1; i <= y; ++i) A.push_back(x - i + 1);
  for (unsigned int i = 1; i <= y; ++i) {
    unsigned int now = i;
    for (unsigned int j = 0; j < (unsigned int)A.size(); ++j) {
      unsigned int G = gcd(now, A[j]);
      A[j] /= G;
      now /= G;
    }
  }
  unsigned int ans = 1;
  for (unsigned int i = 0; i < (unsigned int)A.size(); ++i) ans = ans * A[i];
  return ans;
}
int main(void) {
  cin >> n >> p >> q;
  p = min(p, n - 1);
  Base.init();
  for (unsigned int i = 0; i <= p; ++i) {
    for (unsigned int j = 0; j <= i; ++j) {
      CCC[i - j][i] = Base.A[i - j][i] = C(n - p + i, j);
    }
  }
  for (unsigned int i = 1; i < MAX; i <<= 1) {
    Base = Base * Base;
  }
  All[0].init();
  for (unsigned int i = 0; i <= p; ++i) All[0].A[i][i] = 1;
  All[1] = Base;
  for (unsigned int i = 2; i <= q / MAX; ++i) All[i] = All[1] * All[i - 1];
  for (unsigned int i = 0; i <= p; ++i) dp[0][i] = 1;
  for (unsigned int i = 1; i < MAX; ++i) {
    for (unsigned int a = 0; a <= p; ++a) {
      for (unsigned int b = a; b <= p; ++b) {
        dp[i][b] += dp[i - 1][a] * CCC[a][b];
      }
    }
  }
  unsigned int ans = 0;
  for (unsigned int i = 1; i <= q; ++i) {
    unsigned int a = i / MAX;
    unsigned int b = i % MAX;
    unsigned int it = 0;
    for (unsigned int beds = 0; beds <= p; ++beds) {
      it += dp[b][beds] * All[a].A[beds][p];
    }
    ans ^= it * i;
  }
  cout << ans << endl;
}
