#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const long double PI = 3.14159265358979323846;
const long double gammama = 0.57721566490153286060;
const long double eps = 1e-5;
const int INF = 1000 * 1000 * 1000 + 1;
const long long LINF = (long long)1000 * 1000 * 1000 * 1000 * 1000 * 1000;
const int mod = 1051131;
const long long N = 300100;
long long power(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    n >>= 1;
  }
  return res;
}
vector<int> count(vector<int>& a, int sz, long long p, long long q,
                  long long t) {
  if (sz == 0) {
    return vector<int>(1, (power(p + q, t) * a[0]) % mod);
  }
  int n = (1 << sz);
  for (int i = 0; i < n / 2; ++i) {
    a[i] = (a[i] + a[i + n / 2]) % mod;
    a[i + n / 2] = (a[i] - 2 * a[i + n / 2] + mod) % mod;
  }
  vector<int> tmp = count(a, sz - 1, (2 * p) % mod,
                          ((1 << (sz - 1)) * p - p + q + mod) % mod, t);
  vector<int> res(1 << sz, 0);
  int mult = power((p + q + (mod - ((1 << (sz - 1)) % mod)) * p) % mod, t);
  for (int i = 0; i < res.size() / 2; ++i) {
    res[i] = (((tmp[i] + ((a[i + n / 2] + mod) * 1ll * mult)) % mod) * 1ll *
              ((mod + 1) / 2)) %
             mod;
    res[i + res.size() / 2] =
        (((tmp[i] + ((mod - a[i + n / 2]) * 1ll * mult)) % mod) * 1ll *
         ((mod + 1) / 2)) %
        mod;
  }
  return res;
}
int main() {
  long long m, t, s;
  cin >> m >> t >> s;
  vector<int> a(1 << m);
  for (int i = 0; i < s; ++i) cin >> a[i];
  for (int i = s; i < a.size(); ++i) a[i] = (101 * a[i - s] + 10007) % 1051131;
  vector<int> ans = count(a, m, 1, 0, t);
  int res = 0;
  for (int i = 0; i < ans.size(); ++i) res ^= ans[i] % mod;
  cout << res << endl;
  return 0;
}
