#include <bits/stdc++.h>
using namespace std;
const int M = 4e5 + 10;
int n, a[M], b[M], ans, cnt;
int f(int x, int i) {
  return n - (x >> i) - (lower_bound(b, b + n, (1 << (i + 1)) - x) - b);
}
int32_t main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < 28; i++) {
    for (int j = 0; j < n; j++) b[j] = (a[j] & ((1 << (i + 1)) - 1));
    sort(b, b + n);
    cnt = 0;
    for (int j = 0; j < n; j++) cnt += f(b[j], i);
    ans += (((cnt >> 1) & 1) << (i + 1));
  }
  if (n % 2 == 0)
    for (int i = 0; i < n; i++) ans ^= a[i];
  cout << ans << endl;
  return 0;
}
