#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[400005];
int w, t, k;
int ans = 0;
void rd() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
}
bool cmp(int x, int y) { return (x & w) < (y & w); }
void get() {
  int x = 1, y = 1, p = 0, z = 1;
  for (int i = n; i >= 1; i--) {
    while (x < i && (a[i] & w) + (a[x] & w) < t) x++;
    while (y < i && (a[i] & w) + (a[y] & w) < (t << 1)) y++;
    while (z < i && (a[i] & w) + (a[z] & w) < ((t << 1) | t)) z++;
    if (x > i) x = i;
    if (y > i) y = i;
    if (z > i) z = i;
    p ^= ((i - z + y - x) & 1);
  }
  ans ^= (p << k);
}
signed main() {
  rd();
  w = 1;
  t = 1;
  k = 0;
  for (; w <= 40000000; w = ((w << 1) | 1), t <<= 1, k++) {
    sort(a + 1, a + n + 1, cmp);
    get();
  }
  cout << ans;
  return 0;
}
