#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 5, mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
int n, a[maxn], b[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 0; i < 25; ++i) {
    for (int j = 1; j <= n; ++j) b[j] = a[j] % (1 << i + 1);
    sort(b + 1, b + 1 + n);
    int sum = 0;
    for (int j = 1; j <= n; ++j) {
      int l = max(0, (1 << i) - b[j]);
      int r = (1 << i + 1) - 1 - b[j];
      sum +=
          upper_bound(b + 1, b + 1 + n, r) - lower_bound(b + 1, b + 1 + n, l);
      l = max(0, (1 << i) + (1 << i + 1) - b[j]);
      r = (1 << i + 2) - 2 - b[j];
      sum +=
          upper_bound(b + 1, b + 1 + n, r) - lower_bound(b + 1, b + 1 + n, l);
      if (b[j] + b[j] & (1 << i)) sum--;
    }
    if (sum / 2 & 1) ans |= 1 << i;
  }
  printf("%d\n", ans);
  return 0;
}
