#include <bits/stdc++.h>
using namespace std;
int a[400005];
int st[400005], ln = 0;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long cnt1 = 0, cnt2 = 0, up = 0;
  int ans = 0, val = 1;
  for (int i = 0; i <= 25; i++) {
    cnt1 = 0, cnt2 = 0, ln = 0;
    for (int j = 1; j <= n; j++) {
      if (a[j] & (1 << i))
        ++cnt1;
      else
        ++cnt2;
      st[++ln] = (a[j] & val);
    }
    if ((cnt1 * cnt2 + up) & 1) ans |= 1 << i;
    sort(st + 1, st + ln + 1);
    up = 0;
    for (int j = 1; j <= n; j++) {
      int pos = upper_bound(st + 1, st + ln + 1, val - st[j]) - st;
      up += n - pos + 1;
      if (st[j] + st[j] > val) up--;
    }
    up /= 2;
    val = val << 1 | 1;
  }
  printf("%d\n", ans);
}
