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