#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 50;
const long long INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
int suffix0[maxn], suffix1[maxn];
int num[maxn];
pair<int, int> vec[maxn];
int a[maxn];
int main(int argc, char *argv[]) {
  if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long ans = 0;
  for (int bit = 0; bit <= 27; bit++) {
    int bit_mask = (1 << bit);
    for (int i = 1; i <= n; i++) {
      vec[i].first = a[i] & (bit_mask - 1);
      vec[i].second = 1 & (a[i] >> bit);
    }
    sort(vec + 1, vec + n + 1);
    suffix0[n + 1] = 0;
    suffix1[n + 1] = 0;
    for (int i = n; i >= 1; i--) {
      suffix0[i] = suffix0[i + 1] + (vec[i].second == 0);
      suffix1[i] = suffix1[i + 1] + (vec[i].second == 1);
      num[i] = vec[i].first;
    }
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
      int pos = lower_bound(num + i + 1, num + n + 1, bit_mask - num[i]) - num;
      if (vec[i].second == 0)
        sum += suffix0[pos] + suffix1[i] - suffix1[pos];
      else
        sum += suffix1[pos] + suffix0[i] - suffix0[pos];
    }
    ans += (sum % 2) * bit_mask;
  }
  cout << ans << endl;
  return 0;
}
