#include <bits/stdc++.h>
using namespace std;
const long long maxm = 1e6 + 5;
long long a[maxm];
long long b[maxm];
long long p2[33];
long long ans;
long long n;
long long cal2(long long l, long long r) {
  long long ans = 0;
  long long pl = n, pr = n;
  for (long long i = 1; i <= n; i++) {
    while (pl >= i && b[i] + b[pl] >= l) pl--;
    while (pr >= i && b[i] + b[pr] > r) pr--;
    if (pl <= i && pr <= i) break;
    ans += max(i, pr) - max(i, pl);
  }
  return ans % 2;
}
long long cal(long long k) {
  for (long long i = 1; i <= n; i++) b[i] = (a[i] & (p2[k + 1] - 1));
  sort(b + 1, b + 1 + n);
  long long f1 = cal2(p2[k], p2[k + 1] - 1);
  long long f2 = cal2(p2[k + 1] + p2[k], p2[k + 1] + p2[k] + p2[k] - 1);
  return f1 ^ f2;
}
inline void solve() {
  p2[0] = 1;
  for (long long i = 1; i <= 32; i++) p2[i] = p2[i - 1] * 2;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long ans = 0;
  for (long long i = 0; i <= 30; i++) {
    ans |= (1 << i) * cal(i);
  }
  cout << ans << endl;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
