#include <bits/stdc++.h>
using namespace std;
inline int nextInt() {
  int res;
  assert(cin >> res);
  return res;
}
inline long long nextLong() {
  long long res;
  assert(cin >> res);
  return res;
}
const int MODULO = 1051131;
long long t;
int moduloPow(int a, long long n) {
  int res = 1;
  for (; n > 0; n >>= 1) {
    if ((n & 1) == 1) res = 1LL * res * a % MODULO;
    a = 1LL * a * a % MODULO;
  }
  return res;
}
vector<int> doIt(const vector<int> &a, int p, int q) {
  int n = a.size();
  assert((n & (n - 1)) == 0);
  if (n == 1) {
    vector<int> res = a;
    res[0] = 1LL * res[0] * moduloPow(p + q, t) % MODULO;
    return res;
  }
  n /= 2;
  vector<int> b(n);
  for (int i = 0; i < n; ++i) b[i] = (a[i] + a[i + n]) % MODULO;
  vector<int> res = doIt(b, 2 * p % MODULO, ((n - 1LL) * p + q) % MODULO);
  res.insert(res.end(), res.begin(), res.end());
  int multipler = moduloPow(((1LL - n) * p + q) % MODULO, t);
  for (int i = 0; i < n; ++i) {
    res[i] = (res[i] + 1LL * (a[i] - a[i + n]) * multipler) % MODULO;
    res[i + n] = (res[i + n] - 1LL * (a[i] - a[i + n]) * multipler) % MODULO;
  }
  for (int i = 0; i < 2 * n; ++i) res[i] = res[i] * (MODULO + 1LL) / 2 % MODULO;
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  int m = nextInt();
  t = nextLong();
  int s = nextInt();
  vector<int> a(1 << m);
  for (int i = 0; i < s; ++i) a[i] = nextInt() % MODULO;
  for (int i = s; i < 1 << m; ++i) a[i] = (101 * a[i - s] + 10007) % MODULO;
  vector<int> ans = doIt(a, 1, 0);
  int res = 0;
  for (int i = 0; i < 1 << m; ++i) res ^= (ans[i] + MODULO) % MODULO;
  printf("%d\n", res);
  return 0;
}
