#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
const int MOD = 998244353;
int n;
int a[MAXN], b[MAXN];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int ans = 0;
    for (int i = 0; i < 30; i++) {
      int k = 1 << (i + 1);
      k--;
      for (int j = 1; j <= n; j++) b[j] = a[j] & k;
      long long num = 0;
      sort(b + 1, b + n + 1);
      int p = (1 << i);
      for (int j = 1; j <= n; j++) {
        int p1 = lower_bound(b + j + 1, b + n + 1, p - b[j]) - b;
        int p2 = upper_bound(b + j + 1, b + n + 1, (p << 1) - 1 - b[j]) - b;
        num += p2 - p1 + 1;
        p1 = lower_bound(b + j + 1, b + n + 1, (p << 1) + p - b[j]) - b;
        num += n + 1 - p1 + 1;
      }
      if (num & 1) ans += p;
    }
    printf("%d\n", ans);
  }
}
