#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int a[N], b[N];
int ans, n;
int calc(int L, int R) {
  if (L > R) return 0;
  long long res = 0;
  for (int i = n, l = 1, r = 1; i >= 1; i--) {
    for (; l <= n && b[i] + b[l] < L; l++)
      ;
    for (; r <= n && b[i] + b[r] <= R; r++)
      ;
    res += r - l - (l <= i && i < r);
  }
  return res >> 1 & 1;
}
int sol(int x) {
  for (int i = 1; i <= n; i++) b[i] = a[i] & (1 << x + 1) - 1;
  sort(b + 1, b + n + 1);
  return (calc(1 << x, (1 << x + 1) - 1) ^ calc(3 << x, (1 << x + 2) - 2)) << x;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < 30; i++) ans |= sol(i);
  printf("%d\n", ans);
}
