#include <bits/stdc++.h>
using namespace std;
unsigned int n, p, q, ans[150], Ans, Tmp;
unsigned int Gcd(unsigned int x, unsigned int y) {
  return y ? Gcd(y, x % y) : x;
}
unsigned int Get(unsigned int x, unsigned int ans = 1) {
  vector<unsigned int> A, B;
  for (unsigned int i = 1; i <= x; ++i) A.push_back(n - i + 1), B.push_back(i);
  for (unsigned int &a : A)
    for (unsigned int &b : B) {
      unsigned int gcd = Gcd(a, b);
      a /= gcd, b /= gcd;
    }
  for (unsigned int i = 0; i < x; ++i) ans *= A[i];
  return ans;
}
int main() {
  cin >> n >> p >> q, p = min(p, n - 1);
  for (unsigned int i = 0; i <= p; ++i) ans[i] = Get(i);
  for (unsigned int i = 1; i <= q; ++i) {
    for (unsigned int j = Tmp = 0, tmp = 1; j <= p; ++j, tmp = tmp * i)
      Tmp += ans[j] * tmp;
    Ans ^= i * Tmp;
  }
  cout << Ans;
  return 0;
}
