#include <bits/stdc++.h>
int read() {
  int f = 0;
  char ch;
  while (!isdigit(ch = getchar())) {
  }
  do f = 10 * f + (ch ^ '0');
  while (isdigit(ch = getchar()));
  return f;
}
const int N_MAX = 400003;
int a[N_MAX], b[N_MAX];
int main() {
  int n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  int ans = 0;
  for (int i = 0; i < 26; ++i) {
    int now = 1 << i, base = (now << 1) - 1;
    for (int i = 1; i <= n; ++i) b[i] = a[i] & base;
    std::sort(b + 1, b + n + 1);
    bool flag = 0;
    for (int i = 1; i < n; ++i) {
      int x = std::lower_bound(b + 1, b + n + 1, now - b[i]) - b;
      int y = std::lower_bound(b + 1, b + n + 1, (now * 2) - b[i]) - b;
      int z = std::lower_bound(b + 1, b + n + 1, (now * 3) - b[i]) - b;
      x = std::max(x, i), y = std::max(y, i), z = std::max(z, i);
      flag ^= (y - x) & 1;
      flag ^= (n - z + 1) & 1;
      flag ^= (i >= x && i < y) || (i >= z);
    }
    if (flag) ans |= now;
  }
  printf("%d\n", ans);
  return 0;
}
