#include <bits/stdc++.h>
#pragma Once
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int MAXN = 4e5 + 7;
int n, a[MAXN], dp[MAXN], ans;
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 0; i < 25; ++i) {
    int BASE = (1 << (i + 1)) - 1;
    for (int j = 1; j <= n; ++j) dp[j] = a[j] & BASE;
    sort(dp + 1, dp + n + 1);
    int t1 = n, t2 = n, t3 = n, t4 = n, res = 0;
    for (int k, j = 1; j <= n; ++j) {
      k = (1 << i) * 1 - 1 - dp[j];
      while (t1 && dp[t1] > k) --t1;
      k = (1 << i) * 2 - 1 - dp[j];
      while (t2 && dp[t2] > k) --t2;
      k = (1 << i) * 3 - 1 - dp[j];
      while (t3 && dp[t3] > k) --t3;
      k = (1 << i) * 4 - 1 - dp[j];
      while (t4 && dp[t4] > k) --t4;
      k = (t2 - t1) + (t4 - t3) - ((t1 < j && j <= t2) || (t3 < j && j <= t4));
      res += k & 3;
    }
    ans |= (res >> 1 & 1) << i;
  }
  cout << ans << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
