#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long logn{30};
inline void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
signed main() {
  fastio();
  long long n;
  cin >> n;
  vector<long long> a(n), b(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (long long l = 0; l < logn; l++) {
    long long mask = (1ll << l + 1) - 1;
    for (long long i = 0; i < n; i++) b[i] = a[i] & mask;
    sort(b.begin(), b.end());
    long long cnt = 0;
    for (auto it = b.begin(); it != b.end(); it++) {
      long long bound0 = (1ll << l) - *it;
      long long bound1 = (1ll << l + 1) - *it;
      long long bound2 = (1ll << l + 1) + (1ll << l) - *it;
      cnt -= distance(b.begin(), lower_bound(b.begin(), it, bound0));
      cnt += distance(b.begin(), lower_bound(b.begin(), it, bound1));
      cnt += distance(lower_bound(b.begin(), it, bound2), it);
    }
    if (cnt % 2 == 1) ans = ans + (1 << l);
  }
  cout << ans;
  return 0;
}
