#include <bits/stdc++.h>
using namespace std;
template <typename T>
void debug_out(T t) {
  cerr << t;
}
template <typename A, typename B>
void debug_out(pair<A, B> u) {
  cerr << "(" << u.first << " " << u.second << ")";
}
template <typename T>
void debug_out(vector<T> t) {
  int sz = t.size();
  for (int i = 0; i < sz; i++) {
    debug_out(t[i]);
    if (i != sz - 1) cerr << ", ";
  }
}
template <typename T>
void debug_out(vector<vector<T>> t) {
  int sz = t.size();
  for (int i = 0; i < sz; i++) {
    debug_out(t[i]);
    if (i != sz - 1) cerr << endl;
  }
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  debug_out(H);
  cerr << " ";
  debug_out(T...);
}
template <typename T>
void debug_out(set<T> a) {
  vector<T> _a;
  for (T t : a) _a.push_back(t);
  debug_out(_a);
}
const int N = 26;
int n;
int main() {
  srand(time(0));
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    int p;
    scanf("%d", &p);
    a[i] = p;
  }
  int res = 0;
  for (int i = 1; i < N; i++) {
    vector<int> c(1 << i);
    for (int j = 0; j < n; j++) {
      c[a[j] % (1 << i)]++;
    }
    int l = (1 << i) - 1;
    int r = (1 << i) - 1;
    int z = (1 << i) - 1;
    int sl = 0, sr = 0, sz = 0;
    long long cnt = 0;
    for (int j = 0; j < 1 << i; j++) {
      while (l >= 0 && l + j >= (1 << (i - 1))) {
        sl += c[l];
        l--;
      }
      while (r >= 0 && r + j >= (1 << i)) {
        sr += c[r];
        r--;
      }
      while (z >= 0 && z + j >= (1 << i) + (1 << (i - 1))) {
        sz += c[z];
        z--;
      }
      cnt += 1LL * (sl - sr + sz) * c[j];
    }
    for (int j = 0; j < 1 << i; j++) {
      if ((j * 2) & (1 << (i - 1))) cnt -= c[j];
    }
    assert(!(cnt & 1));
    cnt /= 2;
    if (cnt & 1) {
      res += 1 << (i - 1);
    }
  }
  cout << res;
  return 0;
}
