#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int mo = 1051131, ni2 = (mo + 1) / 2;
int a[((1 << 25) + 10)], ans[((1 << 25) + 10)], m, s;
long long t;
int Pow(int x, long long y) {
  int res = 1;
  while (y) {
    if (y & 1) res = 1ll * res * x % mo;
    x = 1ll * x * x % mo;
    y /= 2;
  }
  return res;
}
void work(int m, int p, int q) {
  if (p < 0) p += mo;
  if (q < 0) q += mo;
  if (m == -1) {
    ans[0] = 1ll * a[0] * Pow(p + q, t) % mo;
    return;
  }
  int s = 1 << m;
  for (int i = 0; i <= s - 1; ++i) {
    a[i] += a[i + s];
    if (a[i] >= mo) a[i] -= mo;
  }
  work(m - 1, 2 * p % mo, (1ll * p * s - p + q) % mo);
  long long tmp = (Pow((-1ll * p * s + p + q) % mo, t) + mo) % mo;
  for (int i = 0; i <= s - 1; ++i) {
    a[i] -= a[i + s];
    if (a[i] < 0) a[i] += mo;
    int d = a[i] - a[i + s];
    if (d < 0) d += mo;
    d = tmp * d % mo;
    ans[i + s] = ans[i] - d;
    if (ans[i + s] < 0) ans[i + s] += mo;
    ans[i] += d;
    if (ans[i] >= mo) ans[i] -= mo;
  }
  for (int i = 0; i <= s * 2 - 1; ++i) ans[i] = 1ll * ans[i] * ni2 % mo;
}
int main() {
  scanf("%d%I64d%d", &m, &t, &s);
  for (int i = 0; i <= s - 1; ++i) scanf("%d", &a[i]);
  for (int i = s; i <= (1 << m) - 1; ++i) a[i] = (101 * a[i - s] + 10007) % mo;
  work(m - 1, 1, 0);
  int fans = 0;
  for (int i = 0; i <= (1 << m) - 1; ++i) fans ^= ans[i];
  printf("%d\n", fans);
}
