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