#include <bits/stdc++.h>
namespace MyMinMax {
template <typename T>
inline T mn(T x, T y) {
  return x < y ? x : y;
}
template <typename T>
inline T mx(T x, T y) {
  return x > y ? x : y;
}
template <typename T>
inline void chmin(T &x, T y) {
  (x > y) && (x = y);
}
template <typename T>
inline void chmax(T &x, T y) {
  (x < y) && (x = y);
}
}  // namespace MyMinMax
using namespace MyMinMax;
namespace IO {
char BB[1 << 18], *SS = BB, *TT = BB;
template <typename T>
inline void nread(T &x) {
  x = 0;
  int fu = 1;
  char c =
      (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 18, stdin), SS == TT)
           ? EOF
           : *SS++);
  while (c > 57 || c < 48) {
    if (c == 45) fu = -1;
    c = (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 18, stdin), SS == TT)
             ? EOF
             : *SS++);
  }
  while (c <= 57 && c >= 48) {
    x = x * 10 + c - 48;
    c = (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 18, stdin), SS == TT)
             ? EOF
             : *SS++);
  }
  x *= fu;
}
template <typename T>
inline void nread(T *bg, T *ed) {
  while (bg != ed) nread(*(bg++));
}
template <typename T, typename... Args>
inline void nread(T &x, Args &...args) {
  nread(x);
  nread(args...);
}
template <typename T>
inline void read(T &x) {
  x = 0;
  char c =
      (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 18, stdin), SS == TT)
           ? EOF
           : *SS++);
  while (c > 57 || c < 48)
    c = (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 18, stdin), SS == TT)
             ? EOF
             : *SS++);
  while (c <= 57 && c >= 48) {
    x = x * 10 + c - 48;
    c = (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 18, stdin), SS == TT)
             ? EOF
             : *SS++);
  }
}
template <typename T>
inline void read(T *bg, T *ed) {
  while (bg != ed) read(*(bg++));
}
template <typename T, typename... Args>
inline void read(T &x, Args &...args) {
  read(x);
  read(args...);
}
char out[1 << 18], *Out = out;
inline void putcha(char x) {
  *Out++ = x;
  if (Out - out >= (1 << 18)) fwrite(out, 1, Out - out, stdout), Out = out;
}
template <typename T>
inline void fprint(T x) {
  if (x < 0) putcha(45), x = -x;
  if (x > 9) fprint(x / 10);
  putcha(x % 10 + 48);
}
template <typename T>
inline void print(T x) {
  fprint(x);
  putcha(10);
}
inline void print(const char *ch) {
  while (*ch != '\0') putcha(*(ch++));
}
inline void put(const char *ch) {
  while (*ch != '\0') putcha(*(ch++));
  putcha(10);
}
template <typename T, typename... Args>
inline void print(T x, Args... args) {
  fprint(x);
  putcha(32);
  print(args...);
}
template <typename... Args>
inline void print(const char *ch, Args... args) {
  while (*ch != '\0') putcha(*(ch++));
  putcha(32);
  print(args...);
}
template <typename T, typename... Args>
inline void printl(T x, Args... args) {
  fprint(x);
  putcha(10);
  print(args...);
}
template <typename... Args>
inline void printl(const char *ch, Args... args) {
  while (*ch != '\0') putcha(*(ch++));
  putcha(10);
  print(args...);
}
template <typename T>
inline void sprint(T x) {
  fprint(x);
  putcha(32);
}
template <typename T, typename... Args>
inline void sprint(T x, Args... args) {
  fprint(x);
  putcha(32);
  sprint(args...);
}
template <typename T>
inline void sprint(T *bg, T *ed) {
  while (bg != ed) sprint(*(bg++));
}
template <typename T>
inline void print(T *bg, T *ed) {
  while (bg != ed) sprint(*(bg++));
  putcha(10);
}
template <typename T>
inline void printl(T *bg, T *ed) {
  while (bg != ed) print(*(bg++));
}
class AutoFlush {
 public:
  ~AutoFlush() { fwrite(out, 1, Out - out, stdout); }
} __AutoFlush;
}  // namespace IO
using namespace IO;
unsigned t[135];
int n, p;
unsigned q;
unsigned f[135];
unsigned gcd(unsigned x, unsigned y) { return !y ? x : gcd(y, x % y); }
inline void init() {
  for (int i = 0; i <= p; ++i) {
    t[i] = 1;
    f[i] = n - i + 1;
    unsigned cur = i;
    for (int j = 1; j <= i; ++j) {
      unsigned g = gcd(f[j], cur);
      f[j] /= g;
      cur /= g;
      t[i] *= f[j];
    }
  }
}
int main() {
  read(n, p, q);
  chmin(p, n - 1);
  init();
  unsigned x = 1, ans = 0;
  for (int j = 1; j <= q; ++j) {
    x = 1;
    unsigned res = 0;
    for (int i = 0; i <= p; ++i) {
      res += x * t[i];
      x *= j;
    }
    ans ^= res * j;
  }
  print(ans);
}
