#include <bits/stdc++.h>
using namespace std;
int maxi = 1 << 24;
class FenwickTree {
  vector<int> bit;
  int n;

 public:
  FenwickTree(int n) {
    this->n = n;
    bit.assign(n, 0);
  }
  FenwickTree(vector<int> a) : FenwickTree(a.size()) {
    for (size_t i = 0; i < a.size(); i++) add(i, a[i]);
  }
  int sum(int r) {
    int ret = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) ret += bit[r];
    return ret;
  }
  int sum(int l, int r) { return sum(r) - sum(l - 1); }
  void add(int idx, int delta) {
    for (; idx < n; idx = idx | (idx + 1)) bit[idx] += delta;
  }
};
int filt(int val, int f) { return (((1 << f) - 1) & val); }
int func(vector<int> vec, int p) {
  int n = vec.size(), ans = 0;
  FenwickTree ft0 = FenwickTree(maxi), ft1 = FenwickTree(maxi);
  for (int i = n - 1; i >= 0; i--) {
    int lim_val = (1 << p) - filt(vec[i], p);
    if ((vec[i] >> p) & 1) {
      ans += ft0.sum(0, lim_val - 1);
      ans += ft1.sum(lim_val, maxi);
      ft1.add(filt(vec[i], p), 1);
    } else {
      ans += ft1.sum(0, lim_val - 1);
      ans += ft0.sum(lim_val, maxi);
      ft0.add(filt(vec[i], p), 1);
    }
  }
  return ans;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, ans = 0;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  for (int j = 0; j < 25; j++) {
    if (func(vec, j) % 2) {
      ans = (ans | (1 << j));
    }
  }
  cout << ans << endl;
}
