#include <bits/stdc++.h>
using namespace std;
const int w = 4e5 + 5;
const long long mod = 1e9 + 7;
const int ww = 4e7 + 5;
int a[w];
bool c[ww];
inline int lowbit(int x) { return x & (-x); }
int v;
void add(int x) {
  while (x < v) {
    c[x] ^= 1;
    x += lowbit(x);
  }
}
bool query(int x) {
  bool res = 0;
  while (x) {
    res ^= c[x];
    x -= lowbit(x);
  }
  return res;
}
int main() {
  int i, j;
  int n;
  cin >> n;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int k = 0; k <= 24; k++) {
    memset(c, 0, sizeof(c));
    int tmp = 0;
    v = 1 << k;
    for (i = 1; i <= n; i++)
      if ((a[i] >> k) & 1) tmp++;
    tmp = (tmp & 1) & ((n - tmp) & 1);
    for (i = 1; i <= n; i++) {
      int pos = a[i] % v;
      if (pos) {
        tmp ^= query(v - 1) ^ query(v - pos - 1);
        add(pos);
      }
    }
    if (tmp) ans |= (1 << k);
  }
  cout << ans << endl;
  return 0;
}
