#include <bits/stdc++.h>
using namespace std;
long long CountFrec(vector<int>& v, int vmin, int vmax) {
  long long ans = 0;
  for (int i = 1; i < v.size(); i++) {
    int from = vmin - v[i];
    int to = vmax - v[i];
    if (from > to) continue;
    int st = lower_bound(v.begin(), v.begin() + i, from) - v.begin();
    int dr = upper_bound(v.begin(), v.begin() + i, to) - v.begin();
    ans += dr - st;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto& i : v) cin >> i;
  int ans = 0;
  for (int b = 0; b < 25; b++) {
    auto elem = v;
    for (auto& i : elem) i &= (2 << b) - 1;
    sort(elem.begin(), elem.end());
    long long nr = CountFrec(elem, 1 << b, (2 << b) - 1);
    nr += CountFrec(elem, 3 << b, (4 << b) - 1);
    if (nr & 1LL) ans += (1 << b);
  }
  cout << ans << '\n';
  return 0;
}
