#include <bits/stdc++.h>
using namespace std;
void Main();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  while (~cin.peek()) Main(), cin.get();
  return 0;
}
void Main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 0;
  for (int i = 0; i < 25; i++) {
    vector<int> b(n);
    for (int j = 0; j < n; j++) b[j] = a[j] ^ (a[j] >> i + 1 << i + 1);
    sort(b.begin(), b.end());
    auto query = [&](int p, int x, int l, int r) {
      return lower_bound(b.begin() + p, b.end(), r - x) -
             lower_bound(b.begin() + p, b.end(), l - x);
    };
    int cnt = 0;
    for (int j = 0; j < n - 1; j++) {
      cnt += query(j + 1, b[j], 1 << i, 2 * (1 << i));
      cnt += query(j + 1, b[j], 3 * (1 << i), 4 * (1 << i));
      cnt = cnt & 1;
    }
    ans |= cnt << i;
  }
  cout << ans << endl;
}
