#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 4e5 + 10;
int a[N], b[N], n;
int bs(int val) {
  if (b[1] > val) return 0;
  if (b[n] < val) {
    return n;
  }
  int ma = n, mi = 1, mid;
  while (mi < ma) {
    mid = mi + ma >> 1;
    if (mi == mid) mid++;
    if (b[mid] <= val)
      mi = mid;
    else
      ma = mid - 1;
  }
  return mi;
}
int main() {
  int x, y;
  ll sum = 0, calc;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int po = 1;
  for (int bi = 0; bi <= 25; bi++) {
    for (int i = 1; i <= n; i++) {
      b[i] = (a[i] & ((1 << (bi + 1)) - 1));
    }
    sort(b + 1, b + n + 1);
    int l, r, itl = 1, itr = 1;
    calc = 0LL;
    for (int i = 1; i <= n; i++) {
      l = (1 << bi) - b[i], r = (1 << bi + 1) - b[i] - 1;
      if (l < 0) l += (1 << bi + 1);
      y = bs(r), x = bs(l - 1);
      x = min(x, n);
      if (l <= r) {
        calc += 1LL * (max(0, y - x));
        if (i > x && i <= y) calc--;
      } else {
        calc += 1LL * (n + y - x);
        if (i > x || i <= y) calc--;
      }
    }
    calc >>= 1;
    if (calc % 2 == 1) sum += 1LL * (1 << bi);
  }
  printf("%lld", sum);
}
