#include <bits/stdc++.h>
using namespace std;
inline long long binpow(long long a, long long b, long long m) {
  long long res = 1;
  for (b %= m - 1, a %= m; b > 0; b >>= 1, a = a * a % m)
    if (b & 1) res = res * a % m;
  return res;
}
int main() {
  int n;
  cin >> n;
  int a[n + 1];
  int maxm = 0;
  for (int i = (1); i <= (n); ++i) cin >> a[i], maxm = max(maxm, a[i]);
  int lim = log2(maxm);
  int temp[n + 1];
  long long ans = 0;
  for (int i = (0); i <= (lim + 1); ++i) {
    for (int j = (1); j <= (n); ++j) temp[j] = a[j] % (1LL << (i + 1));
    sort(temp + 1, temp + 1 + n);
    long long ones = 0;
    for (int j = (1); j <= (n - 1); ++j) {
      int pos1 =
          lower_bound(temp + j + 1, temp + 1 + n, (1LL << i) - temp[j]) - temp;
      int pos2 = (upper_bound(temp + j + 1, temp + 1 + n,
                              (1LL << (i + 1)) - 1 - temp[j]) -
                  temp) -
                 1;
      if (pos2 >= pos1 && j + 1 <= pos1 && pos1 <= n && j + 1 <= pos2 &&
          pos2 <= n)
        ones += pos2 - pos1 + 1;
      pos1 = lower_bound(temp + j + 1, temp + 1 + n,
                         (1LL << (i + 1)) + (1LL << i) - temp[j]) -
             temp;
      pos2 = (upper_bound(temp + j + 1, temp + 1 + n,
                          (1LL << (i + 1)) + (1LL << (i + 1)) - 1 - temp[j]) -
              temp) -
             1;
      if (pos2 >= pos1 && j + 1 <= pos1 && pos1 <= n && j + 1 <= pos2 &&
          pos2 <= n)
        ones += pos2 - pos1 + 1;
    }
    if (ones % 2) ans += 1 << i;
  }
  cout << ans;
}
