#include <bits/stdc++.h>
using namespace std;
const int maxn = 400005;
const int maxm = maxn * 4;
const long long mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
int n, a[maxn];
int p[30];
int c[20000002][2];
int lowbit(int i) { return i & -i; }
void add(int k, int col) {
  k++;
  for (int i = k; i <= 20000001; i += lowbit(i)) {
    c[i][col] += 1;
  }
}
int query(int x, int col) {
  int sum = 0;
  ++x;
  for (int i = x; i > 0; i -= lowbit(i)) sum += c[i][col];
  return sum;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  p[0] = 1;
  for (int i = 1; i <= 24; i++) p[i] = p[i - 1] * 2;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  for (int j = 0; j <= 24; j++) {
    memset(c, 0, sizeof(c));
    long long res = 0;
    for (int i = 1; i <= n; i++) {
      int u = (p[j] & a[i]) ? 1 : 0;
      int v = a[i] % p[j];
      res += query(p[j] - 1 - v, u ^ 1);
      res += query(p[j] - 1, u) - query(p[j] - v - 1, u);
      add(v, u);
    }
    if (res & 1) ans += p[j];
  }
  cout << ans << '\n';
  return 0;
}
