#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool ooo = 1;
const int N = 1e6 + 1;
int n, ans = 0, a[N], b[N], cnt[N];
void baka() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int k = 25; k >= 0; k--) {
    int x = 1 << k;
    for (int i = 1; i <= n; i++) {
      a[i] %= x << 1;
    }
    sort(a + 1, a + n + 1);
    int cnt = 0;
    for (int i = 1, l, r; i <= n; i++) {
      r = lower_bound(a + i + 1, a + n + 1, 2 * x - a[i]) - a;
      l = lower_bound(a + i + 1, a + n + 1, x - a[i]) - a;
      cnt += r - l;
      r = lower_bound(a + i + 1, a + n + 1, 4 * x - a[i]) - a;
      l = lower_bound(a + i + 1, a + n + 1, 3 * x - a[i]) - a;
      cnt += r - l;
    }
    if (cnt & 1) {
      ans += x;
    }
  }
  cout << ans;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  ooo = 0;
  int t = 1;
  while (t--) {
    baka();
  }
}
