#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x);
  read(y);
  read(z);
}
template <class T>
inline void read(T& x, T& y, T& z, T& q) {
  read(x);
  read(y);
  read(z);
  read(q);
}
inline char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int mod = 1051131;
const int inv2 = 525566;
long long n, m, i, T, s;
long long a[(1 << 25) + 1];
long long pow(long long a, long long b, long long c) {
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % c)
    if (b & 1) ans = ans * a % c;
  return ans;
}
void work(int d, int p, int q) {
  if (d == 0) {
    a[0] = a[0] * pow(p + q, T, mod) % mod;
    return;
  }
  long long i, t = 1 << (d - 1), K = pow(-(t - 1) * p + q, T, mod) % mod;
  for (i = 0; i <= t - 1; i++) {
    long long x = a[i], y = a[i + t];
    a[i] = (x + y) % mod;
    a[i + t] = (x - y) * K % mod;
  }
  work(d - 1, p << 1, (1LL * (t - 1) * p + q) % mod);
  for (i = 0; i <= t - 1; i++) {
    long long x = a[i], y = a[i + t];
    a[i] = (x + y) * inv2 % mod;
    a[i + t] = (x - y) * inv2 % mod;
  }
}
int main() {
  cin >> m >> T >> s;
  n = 1 << m;
  for (i = 1; i <= s; i++) read(a[i]);
  for (i = s + 1; i <= n; i++) a[i] = (1LL * 101 * a[i - s] + 10007) % mod;
  a[0] = a[n];
  work(m, 1, 0);
  for (i = 0; i <= n - 1; i++) a[i] = (a[i] % mod + mod) % mod;
  long long ans = 0;
  for (i = 0; i <= n - 1; i++) ans ^= a[i];
  cout << ans << endl;
  scanf("\n");
  return 0;
}
