#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
  T res = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    res = (res << 3) + (res << 1) + c - '0';
    c = getchar();
  }
  x = res * f;
}
const long long N = 400000 + 10;
int n, a[N], b[N], ans;
int find(int x) { return upper_bound(b + 1, b + 1 + n, x) - (b + 1); }
int main() {
  read(n);
  for (int i = 1; i <= n; i++) read(a[i]);
  for (int bit = 0; bit <= 25; bit++) {
    int num = 1 << bit;
    for (int i = 1; i <= n; i++) b[i] = a[i] % (num * 2);
    sort(b + 1, b + 1 + n);
    int tot = 0;
    for (int i = 1; i <= n; i++) {
      int num1 = find(num * 4 - 2 - b[i]) - find(num * 3 - 1 - b[i]);
      int num2 = find(num * 2 - 1 - b[i]) - find(num - 1 - b[i]);
      tot += num1;
      tot += num2;
      if ((b[i] * 2) & num) tot--;
    }
    if ((tot / 2) & 1) ans += num;
  }
  printf("%d", ans);
  return 0;
}
