#include <bits/stdc++.h>
using namespace std;
const int P = 1051131, inv2 = (P + 1) >> 1;
int m, s, a[(1 << 25) + 10], b[(1 << 25) + 10], B[30], M, ans;
long long t;
int ksm(int a, long long b) {
  int ans = 1;
  for (; b; b >>= 1, a = 1ll * a * a % P)
    if (b & 1) ans = 1ll * ans * a % P;
  return ans;
}
void solve(int *a, int *b, int p, int q, int k) {
  if (k == 0) {
    b[1] = 1ll * a[1] * ksm((p + q) % P, t) % P;
    return;
  }
  int M = 1 << k - 1, x, y;
  for (int i = (1); i <= (M); ++i)
    x = a[i], y = a[i + M], a[i] = x + y >= P ? x + y - P : x + y,
    a[i + M] = x - y < 0 ? x - y + P : x - y;
  solve(a, b, 2 * p % P, (1ll * B[k - 1] * p - p + q + P) % P, k - 1);
  for (int i = (1); i <= (M); ++i) b[i + M] = b[i];
  int c = ksm((p + q + P - 1ll * B[k - 1] * p % P) % P, t);
  for (int i = (1); i <= (M); ++i) {
    x = 1ll * a[i + M] * c % P;
    b[i] = b[i] + x >= P ? b[i] + x - P : b[i] + x;
    b[i + M] = b[i + M] - x < 0 ? b[i + M] - x + P : b[i + M] - x;
    b[i] = 1ll * inv2 * b[i] % P;
    b[i + M] = 1ll * inv2 * b[i + M] % P;
  }
}
int main() {
  scanf("%d%lld%d", &m, &t, &s);
  M = 1 << m;
  for (int i = (1); i <= (s); ++i) scanf("%d", &a[i]), a[i] %= P;
  for (int i = (s + 1); i <= (M); ++i) a[i] = (a[i - s] * 101 + 10007) % P;
  B[0] = 1;
  for (int i = (1); i <= (m); ++i) B[i] = 2 * B[i - 1] % P;
  solve(a, b, 1, 0, m);
  for (int i = (1); i <= (M); ++i) ans ^= b[i];
  printf("%d\n", ans);
  return 0;
}
