#include <bits/stdc++.h>
using namespace std;
void file(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
template <typename Tp>
void read(Tp &x) {
  int fh = 1;
  char c = getchar();
  x = 0;
  while (c > '9' || c < '0') {
    if (c == '-') {
      fh = -1;
    }
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c & 15);
    c = getchar();
  }
  x *= fh;
}
int n, m;
int ans, a[1000005];
int b[1000005];
int solve(int id) {
  int ret = 0, l, r;
  for (int i = 1; i <= n; i++) b[i] = (a[i] & ((1 << (id + 1)) - 1));
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    int pl, pr;
    if ((b[i] >> id) & 1) {
      pl = ((1 << (id + 1)) - b[i]);
      pr = pl + (1 << id);
      l = lower_bound(b + 1, b + i, pl) - b - 1;
      ret += l;
      r = lower_bound(b + 1, b + i, pr) - b;
      ret += (i - r);
      ret &= 1;
    } else {
      pl = ((1 << id) - b[i]), pr = ((1 << (id + 1)) - b[i]);
      l = lower_bound(b + 1, b + i, pl) - b;
      r = lower_bound(b + 1, b + i, pr) - b - 1;
      ret += (r - l + 1);
      ret &= 1;
    }
  }
  ret &= 1;
  return ret ? (1 << id) : 0;
}
signed main() {
  read(n);
  for (int i = 1; i <= n; i++) read(a[i]);
  for (int i = 25; ~i; i--) {
    ans |= solve(i);
  }
  printf("%d\n", ans);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
