#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int a[400005];
bool bit[100000005];
bool ans[27];
void update(int x) {
  ++x;
  while (x < 100000005) {
    bit[x] ^= 1;
    x += x & -x;
  }
}
int query(int x) {
  int v = 0;
  while (x) {
    v ^= bit[x];
    x -= x & -x;
  }
  return v;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int j = 0; j < 26; ++j) {
    for (int i = 1; i <= n; ++i) {
      int m = a[i] % (1 << (j + 1));
      if (m <= (1 << j)) {
        ans[j] = ans[j] ^ query((1 << (j + 1)) - m) ^ query((1 << j) - m);
      } else {
        ans[j] = ans[j] ^ query((1 << (j + 1)) - m) ^ query(1 << (j + 1)) ^
                 query((1 << j) * 3 - m);
      }
      update(m);
    }
    for (int i = 1; i <= n; ++i) {
      int m = a[i] % (1 << (j + 1));
      update(m);
    }
  }
  int res = 0;
  for (int j = 0; j < 26; ++j) {
    res |= ans[j] * (1 << j);
  }
  cout << res;
}
