#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
signed main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  for (int bit = 0; bit < 26; bit++) {
    vector<int> b;
    for (int i = 0; i < n; i++) {
      b.push_back(a[i] % (1 << (bit + 1)));
    }
    sort(b.begin(), b.end());
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      auto it1 = lower_bound(b.begin(), b.end(), (1 << bit) - b[i]);
      auto it2 = lower_bound(b.begin(), b.end(), (1 << (bit + 1)) - b[i]);
      it1 = max(it1, b.begin() + i + 1);
      it2 = max(it1, it2);
      cnt += it2 - it1;
      auto it =
          lower_bound(b.begin(), b.end(), (1 << (bit + 1)) + (1 << bit) - b[i]);
      it = max(it, b.begin() + i + 1);
      cnt += b.begin() + n - it;
    }
    if (cnt & 1) {
      ans |= (1 << bit);
    }
  }
  cout << ans << "\n";
  return 0;
}
