#include <bits/stdc++.h>
using namespace std;
const int mo = 1051131;
const int N = 1 << 25;
int a[N], n, s;
long long T;
int power(int x, long long y) {
  int s = 1;
  x %= mo;
  for (; y; y /= 2, x = 1ll * x * x % mo)
    if (y & 1) s = 1ll * s * x % mo;
  return s;
}
void Func(int n, int p, int q) {
  if (n == 0) {
    a[0] = 1ll * a[0] * power(p + q, T) % mo;
    return;
  }
  int m = (1 << (n - 1));
  int r = (m - 1) * p % mo;
  for (int i = (int)(0); i <= (int)(m - 1); i++) {
    int x = a[i], y = a[i + m];
    a[i] = (x + y) % mo;
    a[i + m] = (x + mo - y) % mo;
  }
  Func(n - 1, 2ll * p % mo, (q + r) % mo);
  int val = power(q + mo - r, T);
  for (int i = (int)(0); i <= (int)(m - 1); i++) {
    int x = a[i], y = 1ll * a[i + m] * val % mo;
    a[i] = (x + y) * 1ll * (mo + 1) / 2 % mo;
    a[i + m] = (x + mo - y) * 1ll * (mo + 1) / 2 % mo;
  }
}
int main() {
  scanf("%d%lld%d", &n, &T, &s);
  for (int i = (int)(0); i <= (int)(s - 1); i++) scanf("%d", &a[i]);
  for (int i = (int)(s); i <= (int)((1 << n) - 1); i++)
    a[i] = (a[i - s] * 101 + 10007) % mo;
  Func(n, 1, 0);
  int ans = 0;
  for (int i = (int)(0); i <= (int)((1 << n) - 1); i++) ans ^= a[i];
  printf("%d\n", ans);
}
