#include <bits/stdc++.h>
using namespace std;
long long T;
int M, S, N, IV, sol;
int A[40100100];
void inc(int& x, int y) {
  x += y;
  while (x < 0) x += 1051131;
  while (x >= 1051131) x -= 1051131;
}
int mul(int a, int b) {
  int ret = (a * 1LL * b) % 1051131;
  inc(ret, 0);
  return ret;
}
int mpow(int a, long long b) {
  int ret = 1;
  inc(a, 0);
  while (b) {
    if (b & 1) ret = mul(ret, a);
    a = mul(a, a);
    b /= 2;
  }
  inc(ret, 0);
  return ret;
}
void solve(int k, int p, int q) {
  if (k == 0) {
    A[1] = mul(A[1], mpow(p + q, T));
    return;
  }
  int n = (1 << k) / 2;
  int f = mpow(-mul(n, p) + p + q, T);
  int q2 = mul(n, p) - p + q;
  inc(q2, 0);
  vector<int> xtra(n + 1);
  for (int I = 1; I <= n; I++) {
    inc(xtra[I], mul(A[I] - A[n + I], f));
    inc(A[I], A[n + I]);
  }
  solve(k - 1, 2 * p, q2);
  for (int I = 1; I <= n; I++) {
    A[n + I] = A[I];
    inc(A[n + I], -xtra[I]);
    inc(A[I], xtra[I]);
  }
  for (int I = 1; I <= n + n; I++) {
    A[I] = mul(A[I], IV);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  IV = mpow(2, 1051131 - 4);
  cin >> M >> T >> S;
  N = 1 << M;
  for (int I = 1; I <= S; I++) cin >> A[I];
  for (int I = S + 1; I <= N; I++) A[I] = (101LL * A[I - S] + 10007) % 1051131;
  solve(M, 1, 0);
  for (int I = 1; I <= N; I++) sol ^= A[I];
  cout << sol << endl;
}
