#include <bits/stdc++.h>
int n;
long long solve(std::vector<int>& arr) {
  long long ans = 0;
  int i, j, cnt;
  std::vector<int> b;
  for (i = 0; i <= 24; i++) {
    b.clear();
    for (j = 0; j < n; j++) b.push_back(arr[j] % (1 << (i + 1)));
    std::sort(b.begin(), b.end());
    cnt = 0;
    for (j = 0; j < n; j++) {
      cnt +=
          std::lower_bound(b.begin() + j + 1, b.end(), (1 << (i + 1)) - b[j]) -
          std::lower_bound(b.begin() + j + 1, b.end(), (1 << i) - b[j]);
      cnt += std::upper_bound(b.begin() + j + 1, b.end(),
                              (1 << (i + 2)) - 2 - b[j]) -
             std::lower_bound(b.begin() + j + 1, b.end(),
                              (1 << (i + 1)) + (1 << i) - b[j]);
    }
    if (cnt % 2) ans += (1ll << i);
  }
  return ans;
}
int main() {
  std::cin >> n;
  int i;
  std::vector<int> a(n);
  for (i = 0; i < n; i++) std::cin >> a[i];
  std::cout << solve(a) << '\n';
}
