#include <bits/stdc++.h>
using namespace std;
int m, s;
long long t;
vector<int> a;
const int MOD = 1051131;
int INV;
int next(int v) { return (101 * v + 10007) % MOD; }
int mod_pow(int x, long long t) {
  int res = 1;
  for (int h = 0; (1ll << h) <= t; ++h) {
    if (t & (1ll << h)) res = (long long)res * x % MOD;
    x = (long long)x * x % MOD;
  }
  return res;
}
vector<int> go(const vector<int>& alpha, int p, int q, int k) {
  if (k == 0) {
    int s = (p + q) % MOD;
    int res = mod_pow(s, t);
    return vector<int>(1, (long long)alpha[0] * res % MOD);
  }
  vector<int> new_alpha(1 << (k - 1));
  for (int i = 0; i < (1 << (k - 1)); ++i)
    new_alpha[i] = (alpha[i] + alpha[i + (1 << (k - 1))]) % MOD;
  const vector<int>& prom =
      go(new_alpha, 2 * p % MOD,
         ((long long)p * (1 << (k - 1)) % MOD - p + q + MOD) % MOD, k - 1);
  vector<int> a_alpha(1 << (k - 1));
  for (int i = 0; i < (1 << (k - 1)); ++i)
    a_alpha[i] = (alpha[i] - alpha[i + (1 << (k - 1))] + MOD) % MOD;
  int c = (p + q - (long long)p * (1 << (k - 1)) % MOD + MOD) % MOD;
  int res = mod_pow(c, t);
  for (int i = 0; i < (1 << (k - 1)); ++i)
    a_alpha[i] = (long long)res * a_alpha[i] % MOD;
  vector<int> res_(1 << k);
  for (int i = 0; i < (1 << (k - 1)); ++i)
    res_[i] = (prom[i] + a_alpha[i]) % MOD;
  for (int i = (1 << (k - 1)); i < (1 << k); ++i)
    res_[i] =
        (prom[i - (1 << (k - 1))] - a_alpha[i - (1 << (k - 1))] + MOD) % MOD;
  for (int i = 0; i < (1 << k); ++i) res_[i] = ((long long)INV * res_[i]) % MOD;
  return res_;
}
int main() {
  ios_base::sync_with_stdio(false);
  INV = mod_pow(2, 700751);
  cin >> m >> t >> s;
  a.resize(1 << m);
  for (int i = 0; i < s; ++i) cin >> a[i];
  for (int i = s; i < (1 << m); ++i) a[i] = next(a[i - s]);
  const vector<int>& res = go(a, 1, 0, m);
  int ans = 0;
  for (int i = 0; i < (1 << m); ++i) ans ^= res[i];
  cout << ans;
  return 0;
}
