#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int a[N], second[N], n, cnt, c[2], ans, cur, pos[N], first[2][N];
vector<int> v[2];
void Sort(int i) {
  c[1] = c[0] = 0;
  for (int k = 1; k <= n; k++) {
    int b = ((1 << i) & a[pos[k]]);
    b = min(b, 1);
    c[b]++;
    first[b][c[b]] = pos[k];
  }
  cur = 0;
  for (int j = 0; j <= 1; j++) {
    for (int k = 1; k <= c[j]; k++) {
      cur++;
      pos[cur] = first[j][k];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int k = 1; k <= n; k++) {
    cin >> a[k];
    pos[k] = k;
    cnt += c[(a[k] & 1) ^ 1];
    c[a[k] & 1]++;
    second[k] = a[k] & 1;
  }
  if (cnt % 2) ans = 1;
  Sort(0);
  for (int i = 1; i <= 30; i++) {
    Sort(i);
    for (int k = 1; k <= n; k++) second[k] += a[k] & (1ll << i);
    cnt = 0;
    int l = n, r = n, l1 = n, r1 = n;
    for (int k = 1; k <= n; k++) {
      while (r && second[pos[r]] + second[pos[k]] >= (1 << (i + 1))) r--;
      while (l && second[pos[l]] + second[pos[k]] >= (1 << i)) l--;
      cnt += r - l;
      cnt %= 4;
      while (l1 &&
             second[pos[l1]] + second[pos[k]] >= ((1 << (i + 1)) + (1 << i)))
        l1--;
      cnt += n - l1;
      cnt %= 4;
    }
    int c1 = 0;
    for (int k = 1; k <= n; k++) {
      if ((2 * a[k]) & (1 << i)) c1++;
    }
    c1 %= 4;
    if (((cnt - c1 + 4) / 2) % 2 == 1) ans += 1 << i;
  }
  cout << ans;
}
