#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long ans = 0;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long mx = 0;
  long long tmp = a[n - 1];
  while (tmp) {
    tmp /= 2;
    mx++;
  }
  for (long long j = mx; j >= 0; j--) {
    vector<long long> b;
    for (long long i = 0; i < n; i++) b.push_back(a[i] % (1 << (j + 1)));
    sort(b.begin(), b.end());
    long long cnt = 0;
    for (long long i = 0; i < n - 1; i++) {
      long long cur = b[i];
      if (cur <= (1 << (j))) {
        auto it1 = lower_bound(b.begin() + i + 1, b.end(), (1 << j) - cur);
        auto it2 =
            lower_bound(b.begin() + i + 1, b.end(), (1 << (j + 1)) - cur);
        cnt += it2 - it1;
      } else {
        auto it1 = lower_bound(b.begin() + i + 1, b.end(),
                               (1 << (j + 1)) + (1 << j) - cur);
        cnt += b.end() - it1;
      }
    }
    if (cnt % 2) ans |= (1 << j);
  }
  cout << ans << "\n";
}
