#include <bits/stdc++.h>
const int N = 4e5 + 5;
int a[N], b[N], n;
inline void read(int &x) {
  x = 0;
  char Cget = getchar();
  while (!isdigit(Cget)) {
    Cget = getchar();
  }
  while (isdigit(Cget)) {
    x = x * 10 + Cget - '0';
    Cget = getchar();
  }
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++) {
    read(a[i]);
  }
  int ans = 0;
  for (int i = 0; i <= 25; i++) {
    for (int v = 1; v <= n; v++) {
      b[v] = a[v] % (1 << (i + 1));
    }
    std::sort(b + 1, b + n + 1);
    long long sum = 0;
    for (int v = 1; v <= n; v++) {
      sum += std::lower_bound(b + 1, b + n + 1, (1 << (i + 1)) - b[v]) -
             std::lower_bound(b + 1, b + n + 1, (1 << i) - b[v]);
      sum +=
          std::lower_bound(b + 1, b + n + 1, (1 << (i + 2)) - b[v]) -
          std::lower_bound(b + 1, b + n + 1, (1 << i) + (1 << (i + 1)) - b[v]);
      if ((b[v] << 1) & (1 << i)) {
        sum -= 1;
      }
    }
    if ((sum >> 1) % 2) ans += (1 << i);
  }
  printf("%d\n", ans);
  return 0;
}
