#include <bits/stdc++.h>
using namespace std;
int a[4000007];
int b[4000007];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int an = 0;
  for (int i = 1; i < 2e7; i <<= 1) {
    for (int x = 0; x < n; x++) b[x] = a[x] & (i - 1);
    int sum = 0;
    for (int x = 0; x < n; x++)
      if (a[x] & i) sum++;
    int t = (sum & 1) & ((n - 1) & 1);
    if (t) an ^= i;
    sort(b, b + n);
    int p = n - 1;
    sum = 0;
    for (int j = 0; j < n; j++) {
      p = max(j, p);
      while (p > j && (b[p] + b[j] >= i)) p--;
      sum = n - 1 - p;
      if (sum & 1) an ^= i;
    }
  }
  cout << an;
  return 0;
}
