#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long i = 0, j, k, l, n, m, x, y, q, c, s, e;
  cin >> n;
  vector<long long> a(n);
  for (i = 0; i < n; i++) cin >> a[i];
  x = 30;
  long long ans = 0;
  for (i = 0, j = 1; i < x; i++) {
    vector<long long> b(n);
    for (k = 0; k < n; k++) b[k] = a[k] % (2 * j);
    sort((b).begin(), (b).end());
    l = 0;
    long long t1, t2, t3, t4;
    for (k = 0; k < n; k++) {
      t1 = (lower_bound(b.begin() + k + 1, b.end(), j - b[k]) - b.begin());
      t2 =
          (lower_bound(b.begin() + k + 1, b.end(), (2 * j) - b[k]) - b.begin());
      t3 =
          (lower_bound(b.begin() + k + 1, b.end(), (3 * j) - b[k]) - b.begin());
      t4 = n;
      l += ((t2 - t1) + (t4 - t3));
    }
    if (l % 2) ans += j;
    j *= 2;
  }
  cout << ans;
}
signed main() {
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
