#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[400005];
int t[10000005];
int n;
inline int sum(int *t, int i) {
  i++;
  if (i > 10000001) i = 10000001;
  int ans = 0;
  while (i > 0) {
    ans += t[i];
    i -= (i & -i);
  }
  return ans;
}
inline void up(int *t, int i) {
  i++;
  while (i <= 10000001) {
    t[i]++;
    i += (i & -i);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll i, j;
  int n;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  int c[25] = {0};
  int ans = 0;
  for (j = 0; j <= 24; j++) {
    for (i = 1; i <= n; i++) {
      int y = (a[i] & (1 << j));
      int x = (a[i] & ((1 << (j + 1)) - 1));
      if (y == 0) {
        int mn = (1 << j) - x;
        int mx = mn + (1 << j) - 1;
        c[j] += (sum(t, mx) - sum(t, mn - 1)) & 1;
      } else {
        int mn = 0;
        int mx = (1 << (j + 1)) - x - 1;
        c[j] += (sum(t, mx) - sum(t, mn - 1)) & 1;
        mn = mx + (1 << j) + 1;
        mx = (1 << (j + 1)) - 1;
        c[j] += (sum(t, mx) - sum(t, mn - 1)) & 1;
      }
      up(t, x);
    }
    if (c[j] % 2 == 1) ans += (1 << j);
    memset(t, 0, sizeof t);
  }
  cout << ans;
}
