#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {1, -1, 1, 0, -1, 0, 1, -1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long a[400005];
int b[20000003];
long long query(long long x, long long y) {
  if (y < 0) return 0;
  if (x > 20000000) return 0;
  x = max(x, 0LL);
  y = min(y, 20000000LL);
  long long k = b[y];
  if (x) k -= b[x - 1];
  return k;
}
int main() {
  long long n, i, j;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  long long ans = 0;
  for (i = 25; i >= 0; i--) {
    long long x = (1 << (i + 1));
    for (j = 1; j <= n; j++) {
      long long p = a[j] % x;
      b[p]++;
    }
    for (j = 1; j <= 20000000; j++) b[j] += b[j - 1];
    long long ans1 = 0;
    for (j = 1; j <= n; j++) {
      bool f = 0;
      long long p = a[j] % (1 << (i + 1));
      long long x = (1 << i);
      long long y = (1 << (i + 1)) - 1;
      if (p + p >= x && p + p <= y) f = 1;
      ans1 += query(x - p, y - p);
      long long x1 = (1 << i) + (1 << (i + 1));
      long long y1 = (1 << (i + 2)) - 2;
      ans1 += query(x1 - p, y1 - p);
      if (p + p >= x1 && p + p <= y1) f = 1;
      if (f == 1) ans1--;
    }
    ans1 /= 2;
    if (ans1 % 2 == 1) ans |= (1 << i);
    memset(b, 0, sizeof(b));
  }
  printf("%lld\n", ans);
  return 0;
}
