#include <bits/stdc++.h>
using namespace std;
const int N = 400005;
int n, a[N], b[N], ans;
int main() {
  scanf("%d", &n);
  for (int i = (int)(1); i <= (int)(n); i++) scanf("%d", &a[i]);
  for (int B = 1; B < 2e7; B <<= 1) {
    for (int j = (int)(1); j <= (int)(n); j++) b[j] = a[j] & (B - 1);
    int sum = 0;
    for (int j = (int)(1); j <= (int)(n); j++) sum += ((a[j] & B) != 0);
    if ((sum & 1) && ((n - 1) & 1)) ans ^= B;
    sort(b + 1, b + n + 1);
    int p = n;
    sum = 0;
    for (int j = (int)(1); j <= (int)(n); j++) {
      p = max(p, j);
      for (; p > j && b[j] + b[p] >= B; --p)
        ;
      sum ^= (n - p);
    }
    if (sum & 1) ans ^= B;
  }
  printf("%d\n", ans);
}
