#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int& x : a) scanf("%d", &x);
  ll answer = 0LL;
  for (int k = 0; k < 28; k++) {
    vector<int> b(n);
    for (int i = 0; i < n; i++) {
      b[i] = a[i] % (1 << (k + 1));
    }
    sort(b.begin(), b.end());
    ll count = 0;
    for (int i = 0; i < n; i++) {
      int l =
          lower_bound(b.begin() + i + 1, b.end(), (1 << k) - b[i]) - b.begin();
      int r = lower_bound(b.begin() + i + 1, b.end(), (1 << (k + 1)) - b[i]) -
              b.begin();
      count += r - l;
      l = lower_bound(b.begin() + i + 1, b.end(),
                      (1 << (k + 1)) + (1 << k) - b[i]) -
          b.begin();
      count += n - l;
    }
    if (count & 1) {
      answer |= (1 << k);
    }
  }
  printf("%lld\n", answer);
  return 0;
}
