#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const long long maxn = (long long)4e5 + 5;
const long long mod = 1000000007;
const long long inf = 0x3f3f3f3f;
long long a[maxn], b[maxn], n, ans;
bool cal(long long L, long long R) {
  long long sum = 0;
  for (long long i = n, l = 1, r = 1; i >= 1; --i) {
    while (l <= n && b[i] + b[l] < L) ++l;
    while (r <= n && b[i] + b[r] <= R) ++r;
    sum += r - l - (l <= i && i < r);
  }
  return (sum >> 1) & 1;
}
bool solve(long long k) {
  for (long long i = 1; i <= n; ++i) b[i] = a[i] & ((1 << (k + 1)) - 1);
  sort(b + 1, b + n + 1);
  return cal(1 << k, (1 << (k + 1)) - 1) ^ cal(3 << k, (1 << (k + 2)) - 2);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  for (long long i = 0; i <= 30; ++i) ans |= solve(i) << i;
  cout << ans;
  return 0;
}
