#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + ch - '0', ch = getchar();
  return f * s;
}
int ksm(int bs, long long mi) {
  int ans = 1;
  while (mi) {
    if (mi & 1) ans = 1ll * ans * bs % 1051131;
    bs = 1ll * bs * bs % 1051131;
    mi >>= 1;
  }
  return ans;
}
int a[40001000], n, s, ans;
long long t;
void solve(int n, int p, int q) {
  if (!n) return a[0] = 1ll * a[0] * ksm(p + q, t) % 1051131, void();
  for (int i = 0; i < n; i++) {
    int x = a[i], y = a[i + n];
    a[i] = (x + y) % 1051131, a[i + n] = (x - y + 1051131) % 1051131;
  }
  solve(n >> 1, 2 * p % 1051131, (1ll * (n - 1) * p + q) % 1051131);
  int v = ksm((q - 1ll * (n - 1) * p % 1051131 + 1051131) % 1051131, t);
  for (int i = 0; i < n; i++) {
    int x = a[i], y = 1ll * a[i + n] * v % 1051131;
    a[i] = 1ll * (x + y) * 525566 % 1051131,
    a[i + n] = 1ll * (x + 1051131 - y) * 525566 % 1051131;
  }
  return;
}
int main() {
  n = read(), t = read(), s = read();
  for (int i = 0; i < s; i++) a[i] = read();
  for (int i = s; i < (1 << n); i++)
    a[i] = (101ll * a[i - s] + 10007) % 1051131;
  solve(1 << (n - 1), 1, 0);
  for (int i = 0; i < (1 << n); i++) ans ^= a[i];
  printf("%d\n", ans);
  return 0;
}
