#include <bits/stdc++.h>
using namespace std;
int n, a[400100], b[400100];
int solve(int x) {
  int y = 1 << x;
  int ans = 0;
  for (int i = 1; i <= n; i++) b[i] = a[i] & (y - 1);
  if (!(n & 1))
    for (int i = 1; i <= n; i++) ans ^= a[i] >> x;
  sort(b + 1, b + n + 1);
  for (int i = 1, j = n + 1; i <= n; i++) {
    while (j > i && b[j - 1] + b[i] >= y) j--;
    if (j <= i) j = i + 1;
    ans ^= (n - j + 1);
  }
  return ans & 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  int ans = 0;
  for (int i = 0; i <= 30; i++) ans |= solve(i) << i;
  printf("%d\n", ans);
}
