#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ans = 0;
  int a[400000], b[400000];
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int mask = 1; mask < (1 << 29); mask <<= 1) {
    for (int i = 0; i < N; i++) b[i] = a[i] & (mask - 1);
    sort(b, b + N);
    int curr = N - 1, carr = 0;
    for (int i = 0; i < N; i++) {
      while (curr >= 0 && b[curr] + b[i] >= mask) curr--;
      carr += N - 1 - curr - (curr < i);
    }
    if ((N - 1) % 2)
      for (int i = 0; i < N; i++) ans ^= a[i] & mask;
    if (carr / 2 % 2) ans ^= mask;
  }
  cout << ans << endl;
}
