#include <bits/stdc++.h>
using namespace std;
long long count_sums_in_interval(const vector<int>& nums, int l, int r) {
  long long cnt = 0;
  auto i = nums.begin();
  while (i < nums.end()) {
    cnt += lower_bound(nums.begin(), i, r - *i) -
           lower_bound(nums.begin(), i, l - *i);
    ++i;
  }
  return cnt;
}
void one_case() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& el : a) {
    cin >> el;
  }
  long long res = 0;
  for (int k = 0; k < 30; ++k) {
    vector<int> b(n);
    for (int i = 0; i < n; ++i) {
      b[i] = a[i] % (1 << (k + 1));
    }
    sort(b.begin(), b.end());
    auto cur = count_sums_in_interval(b, 1 << k, 1 << (k + 1)) +
               count_sums_in_interval(b, (1 << k) + (1 << (k + 1)),
                                      (1 << (k + 2)) - 1);
    if (cur % 2) {
      res += 1 << k;
    }
  }
  cout << res << "\n";
}
int main() {
  int t = 1;
  while (t--) {
    one_case();
  }
  return 0;
}
