#include <bits/stdc++.h>
const int mod = 1051131, inv2 = (mod + 1) / 2, phi = 700752;
using namespace std;
int n, T, s;
long long w;
int a[33554440];
void qmo(int &x) { x += (x >> 31) & mod; }
int ksm(int a, int k) {
  int res = 1;
  for (; k; k >>= 1, a = 1ll * a * a % mod)
    if (k & 1) res = 1ll * res * a % mod;
  return res;
}
void calc(int m, int p, int q) {
  if (!m) return a[0] = 1ll * a[0] * ksm(p + q, T) % mod, void();
  for (int i = 0; i < m; i++) {
    int x = a[i], y = a[i + m];
    qmo(a[i] = x + y - mod), qmo(a[i + m] = x - y);
  }
  calc(m >> 1, (p << 1) % mod, (q + 1ll * (m - 1) * p) % mod);
  int w = ksm(q - 1ll * (m - 1) * p % mod + mod, T);
  for (int i = 0; i < m; i++) {
    int x = a[i], y = 1ll * a[i + m] * w % mod;
    a[i] = 1ll * (x + y) * inv2 % mod,
    a[i + m] = 1ll * (x - y + mod) * inv2 % mod;
  }
}
int main() {
  scanf("%d%lld%d", &n, &w, &s);
  if (w > phi)
    T = w % phi + phi;
  else
    T = w;
  for (int i = 0; i < s; i++) scanf("%d", &a[i]);
  for (int i = s; i < (1 << n); i++) a[i] = (a[i - s] * 101 + 10007) % mod;
  calc((1 << n) / 2, 1, 0);
  int res = 0;
  for (int i = 0; i < (1 << n); i++) res ^= a[i];
  printf("%d\n", res);
}
