#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const long long int N = 4e5 + 10;
long long int t;
long long int n;
long long int a[N];
vector<long long int> v;
long long int ans = 0;
long long int cnt;
long long int tmp;
long long int lb, ub;
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int k = 0; k < 26; k++) {
    long long int md = 1 << (k + 1);
    v.clear();
    cnt = 0;
    for (int i = 1; i <= n; i++) v.push_back(a[i] % md);
    sort(v.begin(), v.end());
    for (auto it = v.begin(); it != v.end(); it++) {
      long long int cur = *it;
      tmp = 0;
      auto itt = it;
      itt++;
      lb = (1 << k) - cur;
      ub = (1 << (k + 1)) - 1 - cur;
      auto it1 = lower_bound(itt, v.end(), lb);
      auto it2 = upper_bound(itt, v.end(), ub);
      if (it1 != v.end() && it1 != v.begin()) {
        cnt += distance(it1, it2);
        tmp += distance(it1, it2);
      }
      lb = (1 << (k + 1)) + (1 << k) - cur;
      ub = (1 << (k + 2)) - 1 - cur;
      it1 = lower_bound(itt, v.end(), lb);
      it2 = upper_bound(itt, v.end(), ub);
      if (it1 != v.end() && it1 != v.begin()) {
        cnt += distance(it1, it2);
        tmp += distance(it1, it2);
      }
    }
    if (cnt % 2) ans += (1 << k);
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
