#include <bits/stdc++.h>
using namespace std;
const int N = 1000010, mod = 1e9 + 7, INF = 0x3f3f3f3f;
const double eps = 1e-6;
int n;
int a[N], b[N];
int ans = 0;
int get(int L, int R) {
  if (L > R) return 0;
  int ans = 0;
  for (int i = n, l = 1, r = 1; i >= 1; i--) {
    while (l <= n && b[l] + b[i] < L) l++;
    while (r <= n && b[r] + b[i] <= R) r++;
    ans += r - l - (l <= i && i < r);
  }
  return ans >> 1 & 1;
}
int calc(int x) {
  for (int i = 1; i <= n; i++) b[i] = a[i] & ((1 << (x + 1)) - 1);
  sort(b + 1, b + 1 + n);
  return (get(1 << x, (1 << (x + 1)) - 1) + get(3 << x, (1 << (x + 2)) - 2)) %
         2;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < 25; i++) ans += calc(i) << i;
  printf("%d\n", ans);
  return 0;
}
