#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
inline int read() {
  int s = 0, w = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
int n, p[N], res, w = 1, t = 1, now;
inline bool cp(int A, int B) { return (A & w) < (B & w); }
int main() {
  n = read();
  for (int i = 1; i <= n; i++) p[i] = read();
  for (; w <= 40000000; now++, w = ((w << 1) | 1), t <<= 1) {
    sort(p + 1, p + 1 + n, cp);
    int a, b, c;
    a = b = c = 1;
    int pro = 0;
    for (register int j = n; j; j--) {
      while (a < j && t > (p[a] & w) + (p[j] & w)) a++;
      a = min(a, j);
      while (b < j && (t << 1) > (p[b] & w) + (p[j] & w)) b++;
      b = min(b, j);
      while (c < j && ((t << 1) | t) > (p[c] & w) + (p[j] & w)) c++;
      c = min(c, j);
      pro ^= ((b - a - c + j) & 1);
    }
    res ^= (pro << now);
  }
  printf("%d\n", res);
  return 0;
}
