#include <bits/stdc++.h>
using namespace std;
long long mod = (1000000007LL);
inline long long poww(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
inline pair<long long, long long> operator+(pair<long long, long long> A,
                                            pair<long long, long long> B) {
  return pair<long long, long long>(A.first + B.first, A.second + B.second);
}
inline pair<long long, long long> operator-(pair<long long, long long> A,
                                            pair<long long, long long> B) {
  return pair<long long, long long>(A.first - B.first, A.second - B.second);
}
inline long long mult(long long a, long long b) { return (a * b) % mod; }
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long n, m, k, v[400050], ans;
pair<long long, long long> TT, w[400050];
string second;
long long less_than(vector<long long> w, long long x, long long en) {
  long long ini = 0, fim = en, mid, best = -1;
  while (fim >= ini) {
    mid = (ini + fim) / 2;
    if (w[mid] <= x) {
      best = mid;
      fim = mid - 1;
    } else
      ini = mid + 1;
  }
  return best + 1;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
  }
  for (long long pot = 25; pot >= 0; pot--) {
    vector<long long> val;
    long long qtd = 0;
    for (long long i = 1; i <= n; i++) {
      while (v[i] >= (1 << (pot + 1))) v[i] -= (1 << (pot + 1));
      val.push_back(v[i]);
    }
    sort(begin(val), end(val));
    vector<long long> aux;
    aux.push_back(val[0]);
    for (long long i = 1; i < n; i++) {
      long long cnt =
          upper_bound(begin(aux), end(aux), (1 << (pot + 1)) - 1 - val[i]) -
          lower_bound(begin(aux), end(aux), (1 << pot) - val[i]);
      cnt += upper_bound(begin(aux), end(aux), (1 << (pot + 2)) - 2 - val[i]) -
             lower_bound(begin(aux), end(aux),
                         (1 << (pot + 1)) + (1 << pot) - val[i]);
      qtd += max(0LL, cnt);
      aux.push_back(val[i]);
    }
    ans += (1LL << pot) * (qtd & 1);
  }
  cout << ans << "\n";
}
