#include <bits/stdc++.h>
using namespace std;
const int MAXN = (1 << 25) + 1, MOD = 1051131;
int n, m, a[MAXN];
long long k;
int Pow(int a, long long b) {
  int d = 1;
  for (; b; d = (b & 1) ? (long long)d * a % MOD : d,
            a = (long long)a * a % MOD, b /= 2)
    ;
  return d;
}
void solve(int dep, int p, int q) {
  if (!dep) {
    a[0] = (long long)a[0] * Pow(p + q, k) % MOD;
    return;
  }
  int n = 1 << (dep - 1),
      s = Pow((q - (long long)(n - 1) * p % MOD + MOD) % MOD, k);
  for (int i = 0; i < n; ++i)
    a[i] = (a[i] + a[i + n]) % MOD,
    a[i + n] = (long long)(a[i] - a[i + n] - a[i + n] + MOD + MOD) * s % MOD;
  solve(dep - 1, p * 2 % MOD, ((long long)(n - 1) * p + q) % MOD);
  int Inv2 = 525566;
  for (int i = 0; i < n; ++i) {
    int A = a[i], B = a[i + n];
    a[i] = (long long)(A + B) * Inv2 % MOD;
    a[i + n] = (long long)(A - B + MOD) * Inv2 % MOD;
  }
}
int main() {
  int s;
  cin >> m >> k >> s;
  n = 1 << m;
  for (int i = 1; i <= s; ++i) scanf("%d", &a[i]);
  for (int i = s + 1; i <= n; ++i)
    a[i] = ((long long)a[i - s] * 101 + 10007) % MOD;
  a[0] = a[n];
  solve(m, 1, 0);
  int Tohka = 0;
  for (int i = 0; i < n; ++i) Tohka ^= (a[i] % MOD);
  cout << Tohka << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
