#include <bits/stdc++.h>
using namespace std;
const long long logN = 20;
const long long M = 1000000007;
const long long INF = 1e12;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (long long i = 0; i < 31; i++) {
    vector<long long> v(n);
    long long x = (long long)pow(2, i);
    for (long long j = 0; j < n; j++) v[j] = a[j] % (2 * x);
    sort(v.begin(), v.end());
    long long p = n - 1, q = n - 1, r = n - 1;
    long long tmp = 0;
    for (long long j = 0; j < n - 1; j++) {
      p = max(j + 1, p);
      q = max(j + 1, q);
      r = max(j + 1, r);
      while (v[j] + v[p] >= x && p > j) p--;
      while (v[j] + v[q] >= (2 * x) && q > j) q--;
      while (v[j] + v[r] >= (3 * x) && r > j) r--;
      tmp += (max((long long)0, (q - p))) + (max((long long)0, (n - 1 - r)));
    }
    ans += (tmp % 2) * x;
  }
  cout << ans;
}
