#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  long long u = 1;
  for (long long i = 0; i <= 46; i++) {
    vector<long long> b(n);
    long long conta = 0;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] & u) conta++;
      b[i] = a[i] & (u - 1);
    }
    sort(b.begin(), b.end());
    int it1 = 0, it2 = n - 1;
    while (it2 > it1 && it1 < n && it2 < n) {
      if (b[it1] + b[it2] >= u) {
        if (it2 - 1 > it1 && b[it1] + b[it2 - 1] >= u)
          it2--;
        else {
          sum += n - it2;
          it1++;
          if (it2 == it1) it2++;
        }
      } else
        it1++;
    }
    if ((n - 1) & 1 && conta & 1) sum += 1;
    if (sum & 1) ans += u;
    u <<= 1;
  }
  cout << ans << endl;
}
