#include <bits/stdc++.h>
using namespace std;
unsigned int ans, n, p, q, c[135], now[135];
unsigned int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int main() {
  ans = 0;
  cin >> n >> p >> q;
  for (unsigned int i = 0; i <= min(n - 1, p); ++i) {
    for (unsigned int j = 1; j <= i; ++j) now[j] = n - j + 1;
    for (unsigned int j = 1; j <= i; ++j) {
      int jj = j;
      for (unsigned int k = i; k >= 1; --k) {
        int g = gcd(now[k], jj);
        if (g != 1) {
          jj /= g;
          now[k] /= g;
          if (g == 1) break;
        }
      }
    }
    c[i] = 1;
    for (unsigned int j = 1; j <= i; ++j) c[i] = c[i] * now[j];
  }
  for (unsigned int i = 1; i <= q; ++i) {
    unsigned int re = 0, po = 1;
    for (unsigned int j = 0; j <= min(n - 1, p); ++j) {
      re += c[j] * po;
      po = po * i;
    }
    ans ^= (re * i);
  }
  cout << ans << endl;
}
