#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 7;
const int inf = INT_MAX;
const long long inff = 1e18;
const long long mod = 1e9 + 7;
int cnt[34400001], p[34400001];
int n;
int a[400007];
inline int prefix(int x) { return (x == -1 ? 0 : p[x]); }
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int now = 0, ans = 0;
  for (int j = 0; j <= 24; j++) {
    now |= (1 << j);
    for (int i = 0; i <= now; i++) cnt[i] = 0;
    for (int i = 1; i <= n; i++) cnt[a[i] & now]++;
    for (int i = 0; i <= now; i++) p[i] = (i == 0 ? cnt[0] : cnt[i] + p[i - 1]);
    long long cntpair = 0;
    for (int i = 0; i <= now; i++) {
      if (i >= (1 << j))
        cntpair += cnt[i] * 1ll *
                   (prefix(now) - prefix(now - (i - (1 << j))) +
                    prefix(now - i) - prefix(-1));
      else
        cntpair +=
            cnt[i] * 1ll * (prefix(now - i) - prefix(now - i - (1 << j)));
      if (((i + i) & (1 << j)) >= (1 << j)) cntpair -= cnt[i];
    }
    cntpair >>= 1;
    if (cntpair & 1) ans ^= (1 << j);
  }
  cout << ans << '\n';
}
