#include <bits/stdc++.h>
#pragma GCC optimize("01")
using namespace std;
const long long mod = 1e9 + 7;
const int Max = 5e6 + 1;
const int Maxbit = 26;
long long n;
int a[Max], temp[Max];
long long ans = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 25; i >= 0; i--) {
    for (int j = 0; j < n; j++) a[j] &= (1 << (i + 1)) - 1;
    sort(a, a + n);
    for (int j = 0; j < n - 1; j++) {
      if ((upper_bound(a + j + 1, a + n, (1 << i + 1) - 1 - a[j]) -
           lower_bound(a + j + 1, a + n, (1 << i) - a[j])) &
          1)
        ans ^= (1 << (i));
      if ((upper_bound(a + j + 1, a + n, (1 << i + 2) - 2 - a[j]) -
           lower_bound(a + j + 1, a + n, (1 << i + 1) + (1 << i) - a[j])) &
          1)
        ans ^= (1 << i);
    }
  }
  cout << ans;
  return 0;
}
