#include <bits/stdc++.h>
using namespace std;
const int N = 400100;
int n, a[N], p[N], b[N], ans;
int query(int x, int l, int r) {
  int h, t;
  h = lower_bound(b + 1, b + 1 + n, l - b[x]) - b;
  t = upper_bound(b + 1, b + 1 + n, r - b[x]) - b - 1;
  if (t <= x) return 0;
  h = max(h, x + 1);
  return t - h + 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  p[0] = 1;
  for (int i = 1; i <= 30; i++) p[i] = p[i - 1] * 2;
  for (int k = 0; k <= 25; k++) {
    for (int j = 1; j <= n; j++) b[j] = a[j] % p[k + 1];
    sort(b + 1, b + 1 + n);
    int cnt = 0;
    for (int j = 1; j < n; j++) {
      cnt += query(j, p[k], p[k + 1] - 1);
      cnt += query(j, p[k] + p[k + 1], p[k + 2] - 2);
    }
    if (cnt & 1) ans += (1 << k);
  }
  printf("%d\n", ans);
}
