#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(time(nullptr));
const long long INF = 1e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  long long pw[30];
  pw[0] = 1;
  for (long long i = 1; i < 30; i++) {
    pw[i] = pw[i - 1] * 2;
  }
  for (long long k = 24; k > -1; k--) {
    vector<long long> b = a;
    for (long long i = 0; i < n; i++) {
      for (long long j = k + 1; j <= 24; j++) {
        if (b[i] & (1 << j)) {
          b[i] -= (1 << j);
        }
      }
    }
    sort(b.begin(), b.end());
    long long cnt = 0;
    for (long long i = 0; i < n; i++) {
      long long id1 = lower_bound(b.begin(), b.end(), pw[k] - b[i]) - b.begin(),
                id2 = lower_bound(b.begin(), b.end(), pw[k + 1] - b[i]) -
                      b.begin() - 1;
      if (id1 < i) {
        id2 = min(id2, i - 1);
        cnt += id2 - id1 + 1;
      }
      id1 =
          lower_bound(b.begin(), b.end(), pw[k] + pw[k + 1] - b[i]) - b.begin(),
      id2 = lower_bound(b.begin(), b.end(), pw[k + 2] - b[i]) - b.begin() - 1;
      if (id1 < i) {
        id2 = min(id2, i - 1);
        cnt += id2 - id1 + 1;
      }
    }
    if (cnt % 2) {
      ans ^= (1 << k);
    }
  }
  cout << ans;
  return 0;
}
