#include <bits/stdc++.h>
using namespace std;
int n, a[400005], b[400005], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int t = log2(20000000);
  for (int p = 0; p <= t; p++) {
    for (int i = 1; i <= n; i++) b[i] = a[i] & ((1 << (p + 1)) - 1);
    sort(b + 1, b + n + 1);
    int l1, r1, l2, r2;
    l1 = r1 = l2 = r2 = n;
    int c = 0;
    for (int i = 1; i <= n; i++) {
      while (l1 && (b[l1] + b[i] >= 1 << p)) l1--;
      while (r1 && (b[r1] + b[i] >= (1 << (p + 1)))) r1--;
      while (r2 && (b[l2] + b[i] >= (1 << p) + (1 << (p + 1)))) l2--;
      while (r2 && (b[r2] + b[i] >= (1 << (p + 2)))) r2--;
      c += max(0, min(r1, n) - max(l1 + 1, i + 1) + 1);
      if (r2) c += max(0, min(r2, n) - max(l2 + 1, i + 1) + 1);
    }
    if (c & 1) ans += 1 << p;
  }
  printf("%d", ans);
  return 0;
}
