#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool uin(T& a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
inline bool uax(T& a, T b) {
  return a < b ? (a = b, true) : false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];
  int ans = 0;
  for (int z = 25; z >= 0; --z) {
    int one = 0, zer = 0;
    for (int i = 0; i < N; ++i)
      if (A[i] >> z & 1)
        ++one;
      else
        ++zer;
    int parity = (one % 2) * (zer % 2);
    vector<int> rem(N);
    for (int i = 0; i < N; ++i) rem[i] = A[i] & ((1 << z) - 1);
    sort(rem.begin(), rem.end());
    int carry = 0;
    for (int i = 0, j = N; i < N; ++i) {
      while (j - 1 > i && rem[j - 1] + rem[i] >= (1 << z)) --j;
      carry += N - max(j, i + 1);
      carry %= 2;
    }
    parity = (parity + carry) % 2;
    ans += parity << z;
  }
  cout << ans << '\n';
}
