#include <bits/stdc++.h>
using namespace std;
const int MAXN = 33554440, Mo = 1051131;
const long long Half = 525566;
long long T;
int A[MAXN], M, S;
long long quick(int a, long long b) {
  if (!b) return 1;
  long long mid = quick(a, b / 2);
  if (b & 1) return mid * mid % Mo * a % Mo;
  return mid * mid % Mo;
}
void Dfs(int N, int p, int q) {
  if (N == 1) {
    A[1] = A[1] * quick(p + q, T) % Mo;
    return;
  }
  N >>= 1;
  for (int i = 1; i <= N; i++) {
    int a1 = A[i], a2 = A[i + N];
    A[i] = (a1 + a2) % Mo, A[i + N] = (a1 - a2 + Mo) % Mo;
  }
  Dfs(N, 2 * p % Mo, (N * (long long)p % Mo - p + q + Mo) % Mo);
  int hal = quick((p + q - N * (long long)p % Mo + Mo) % Mo, T);
  for (int i = 1; i <= N; i++) {
    int a1 = A[i], a2 = A[i + N] * (long long)hal % Mo;
    A[i] = (a1 + a2) * Half % Mo, A[i + N] = (a1 - a2 + Mo) * Half % Mo;
  }
}
int main() {
  scanf("%d%lld%d", &M, &T, &S);
  for (int i = 1; i <= S; i++) scanf("%d", &A[i]);
  int N = 1 << M;
  for (int i = S + 1; i <= N; i++)
    A[i] = (A[i - S] * (long long)101 + 10007) % Mo;
  Dfs(N, 1, 0);
  int Ans = 0;
  for (int i = 1; i <= N; i++) Ans ^= A[i];
  printf("%d\n", Ans);
}
