#include <bits/stdc++.h>
using namespace std;
int n, m, s;
long long t;
int a[35000000], b[35000000], c[1051131 + 5], p[1051131 + 5],
    prime[1051131 / 10], num, Rev;
int power(int a, long long b) {
  int c = 1;
  while (b) {
    if (b & 1) c = (long long)c * a % 1051131;
    b >>= 1;
    a = (long long)a * a % 1051131;
  }
  return c;
}
void FWT(int a[]) {
  int x, y;
  for (int i = 1; i < n; i <<= 1)
    for (int j = 0; j < n; j += i << 1)
      for (int k = 0; k < i; k++) {
        x = a[j + k], y = a[j + k + i];
        a[j + k] = (x + y) % 1051131;
        a[j + k + i] = (x - y + 1051131) % 1051131;
      }
}
int main() {
  scanf("%d%I64d%d", &m, &t, &s);
  n = 1 << m;
  for (int i = 0; i <= s - 1; i++) scanf("%d", &a[i]);
  for (int i = s; i <= n - 1; i++) a[i] = (101 * a[i - s] + 10007) % 1051131;
  for (int i = 0; i <= n - 1; i++) b[i] = (i & -i) % 1051131;
  b[0] = 1;
  FWT(a);
  FWT(b);
  c[1] = 1;
  for (int i = 2; i <= 1051131; i++) p[i] = i;
  for (int i = 2; i <= 1051131; i++) {
    if (p[i] == i) {
      prime[++num] = i;
      c[i] = power(i, t);
    } else
      c[i] = (long long)c[i / p[i]] * c[p[i]] % 1051131;
    for (int j = 1;
         j <= num && prime[j] * i <= 1051131 && p[prime[j] * i] > prime[j]; j++)
      p[prime[j] * i] = prime[j];
  }
  for (int i = 0; i <= n - 1; i++) b[i] = c[b[i]];
  for (int i = 0; i <= n - 1; i++) a[i] = (long long)a[i] * b[i] % 1051131;
  Rev = power(n, 700751);
  FWT(a);
  for (int i = 0; i <= n - 1; i++) a[i] = (long long)a[i] * Rev % 1051131;
  int Ans = 0;
  for (int i = 0; i <= n - 1; i++) Ans ^= a[i];
  printf("%d\n", Ans);
}
