#include <bits/stdc++.h>
using namespace std;
int n;
int a[1000010], b[1000010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 0; i < 30; i++) {
    int k = (1 << (i + 1)) - 1;
    for (int j = 0; j < n; j++) {
      b[j] = a[j] & k;
    }
    int num = 0;
    sort(b, b + n);
    int p = (1 << i);
    for (int j = 0; j < n; j++) {
      int p1 = lower_bound(b + j + 1, b + n, p - b[j]) - b;
      int p2 = upper_bound(b + j + 1, b + n, (p << 1) - 1 - b[j]) - b;
      num += p2 - p1 + 1;
      p1 = lower_bound(b + j + 1, b + n, (p << 1) + p - b[j]) - b;
      num += n - p1 + 1;
    }
    if (num & 1) ans += p;
  }
  printf("%d\n", ans);
  return 0;
}
