#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int ans = 0;
  for (long long int k = 0; k < 27; k++) {
    vector<long long int> b(n);
    for (long long int i = 0; i < n; i++) b[i] = a[i] % (1 << (k + 1));
    sort(b.begin(), b.end());
    long long int count = 0;
    for (long long int i = 0; i < n; i++) {
      count += lower_bound(b.begin() + i + 1, b.end(), (1 << (k + 1)) - b[i]) -
               lower_bound(b.begin() + i + 1, b.end(), (1 << k) - b[i]);
      count += b.end() - lower_bound(b.begin() + i + 1, b.end(),
                                     (1 << (k + 1)) + (1 << k) - b[i]);
    }
    ans += (count & 1) * (1 << k);
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int T = 1;
  while (T--) {
    solve();
    cout << endl;
  }
  return 0;
}
