#include <bits/stdc++.h>
using namespace std;
int a[(int)4e5 + 5];
int c[(1 << 25) + 5];
int lowbit(int x) { return x & (-x); }
void Add(int pos, int len, int x) {
  while (pos <= len) {
    c[pos] += x;
    pos += lowbit(pos);
  }
}
int sum(int pos) {
  if (pos <= 0) return 0;
  int res = 0;
  while (pos > 0) {
    res += c[pos];
    pos -= lowbit(pos);
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int ans = 0;
  int num = 1;
  for (int i = 0; i < 25; i++) {
    num <<= 1;
    memset(c, 0, num * sizeof(int));
    int res = 0;
    for (int j = 0; j < n; j++) {
      int x = a[j] % num;
      int xx = sum((num - 1) - x + 1);
      int yy = sum((num >> 1) - x);
      res += xx - yy;
      if (x > num >> 1) {
        xx = sum(num);
        yy = sum(num - (x - (num >> 1)));
        res += xx - yy;
      }
      if (res & 1) {
        res = 1;
      } else
        res = 0;
      Add(x + 1, num, 1);
    }
    if (res & 1) ans |= (1 << i);
  }
  printf("%d\n", ans);
  return 0;
}
