#include <bits/stdc++.h>
using namespace std;
vector<int> v, pows;
int n;
bool get(int k) {
  int cnt = 0;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) a[i] = v[i] % pows[k + 1];
  sort(a.begin(), a.end());
  for (int i = 0; i < n - 1; ++i) {
    int L, R;
    L = lower_bound(a.begin() + i + 1, a.end(), pows[k] - a[i]) - a.begin();
    R = lower_bound(a.begin() + i + 1, a.end(), pows[k + 1] - a[i]) - a.begin();
    cnt += (R - L + 1);
    L = lower_bound(a.begin() + i + 1, a.end(), pows[k + 1] + pows[k] - a[i]) -
        a.begin();
    R = lower_bound(a.begin() + i + 1, a.end(), pows[k + 2] - 1 - a[i]) -
        a.begin();
    cnt += (R - L + 1);
  }
  return cnt % 2;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int ans = 0;
  cin >> n;
  v.resize(n);
  pows.assign(30, 1);
  for (int i = 1; i <= 29; ++i) {
    pows[i] = pows[i - 1] * 2;
  }
  for (int i = 0; i < n; ++i) cin >> v[i];
  for (int k = 0; k <= 24; ++k) {
    if (get(k)) ans += pows[k];
  }
  cout << ans;
  return 0;
}
