#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int a[N], b[N];
int main() {
  int n, m, i, j, k;
  while (scanf("%d", &n) == 1) {
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    int ans = 0;
    for (k = 0; k <= 25; k++) {
      int pos = 0;
      for (i = 1; i <= n; i++) {
        b[i] = (a[i] & ((1 << k + 1) - 1));
      }
      sort(b + 1, b + 1 + n);
      for (i = 1; i <= n; i++) {
        int l = max(0, (1 << k) - b[i]);
        int r = (1 << (k + 1)) - 1 - b[i];
        int cnt =
            ((upper_bound(b + 1, b + i, r)) - (lower_bound(b + 1, b + i, l)));
        if (cnt & 1) ans ^= (1 << k);
        l = max(((1 << (k + 1)) + (1 << k)) - b[i], 0);
        r = ((1 << (k + 2)) - 1) - b[i];
        cnt = ((upper_bound(b + 1, b + i, r)) - (lower_bound(b + 1, b + i, l)));
        if (cnt & 1) ans ^= (1 << k);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
