#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int ans = 0;
  vector<int> b(n);
  for (int k = 0; k < 26; ++k) {
    for (int i = 0, mod = (1 << (k + 1)); i < n; ++i) b[i] = a[i] % mod;
    sort(b.begin(), b.end());
    long long cnt = 0;
    int l1 = (1 << k), r1 = (1 << (k + 1)) - 1;
    int l2 = (1 << (k + 1)) + (1 << k), r2 = (1 << (k + 2)) - 2;
    for (int i = 0; i < n; ++i) {
      int l = l1 - b[i], r = r1 - b[i];
      cnt += upper_bound(b.begin(), b.begin() + i, r) -
             lower_bound(b.begin(), b.begin() + i, l);
    }
    for (int i = 0; i < n; ++i) {
      int l = l2 - b[i], r = r2 - b[i];
      cnt += upper_bound(b.begin(), b.begin() + i, r) -
             lower_bound(b.begin(), b.begin() + i, l);
    }
    if (cnt & 1) ans += (1 << k);
  }
  cout << ans << endl;
  return 0;
}
