#include <bits/stdc++.h>
using namespace std;
int64_t find(const vector<int>& a, int left, int right) {
  int64_t sum = 0;
  int n = a.size();
  for (int i = 0; i < n; ++i) {
    auto begin = a.begin() + i + 1;
    auto low = lower_bound(begin, a.end(), left - a[i]);
    auto up = lower_bound(begin, a.end(), right - a[i]);
    if (up > low) {
      sum += up - low;
    }
  }
  return sum;
}
int solvek(vector<int>& a, int k) {
  sort(a.begin(), a.end());
  int64_t sum1 = find(a, k, 2 * k);
  int64_t sum2 = find(a, 3 * k, 4 * k);
  int64_t sum = sum1 + sum2;
  return sum % 2 == 1 ? k : 0;
}
int solve(const vector<int>& a) {
  int res = 0;
  for (int k = 0; k < 25; ++k) {
    vector<int> rem;
    int k2 = 1 << k;
    for (const int& x : a) {
      int val = x % (2 * k2);
      rem.push_back(val);
    }
    res += solvek(rem, k2);
  }
  return res;
}
int solveDummy(const vector<int>& a) {
  int res = 0;
  int n = a.size();
  for (int i = 0; i < n - 1; ++i) {
    for (int j = i + 1; j < n; ++j) {
      res = res ^ (a[i] + a[j]);
    }
  }
  return res;
}
void genTest(int n, int max) {
  freopen("1.in", "w", stdout);
  cout << n << endl;
  for (int i = 0; i < n; ++i) {
    cout << rand() % max << " ";
  }
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int& x : a) {
    cin >> x;
  }
  cout << solve(a) << endl;
}
