#include <bits/stdc++.h>
using namespace std;
mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
int a[400005], b[400005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  long long ans = 0;
  for (int k = 0; k <= 25; ++k) {
    for (int i = 1; i <= n; ++i) b[i] = a[i] % (1 << (k + 1));
    sort(b + 1, b + 1 + n);
    int tmp = 0;
    for (int i = 1; i <= n; ++i) {
      tmp += lower_bound(b + 1 + i, b + 1 + n, (1 << (k + 1)) - b[i]) -
             lower_bound(b + 1 + i, b + 1 + n, (1 << k) - b[i]);
      tmp +=
          lower_bound(b + 1 + i, b + 1 + n, (1 << (k + 2)) - 1 - b[i]) -
          lower_bound(b + 1 + i, b + 1 + n, (1 << k) + (1 << (k + 1)) - b[i]);
    }
    if (tmp & 1) ans |= 1 << k;
  }
  cout << ans << '\n';
}
