#include <bits/stdc++.h>
#pragma GCC optimize(2)
const int maxn = 4e5 + 5;
template <typename T>
inline T max(const T &a, const T &b) {
  return a > b ? a : b;
}
template <typename T>
inline T Abs(const T &val) {
  return val > 0 ? val : -val;
}
struct IO {
  char c;
  inline char gc() {
    static char buf[maxn], *p1 = buf, *p2 = buf;
    return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, maxn, stdin), p1 == p2)
               ? EOF
               : *p1++;
  }
  template <typename T>
  inline IO &operator>>(T &_) {
    _ = 0;
    bool f = 1;
    c = gc();
    while (c < '0' || c > '9') {
      if (c == '-') f = 0;
      c = gc();
    }
    while (c >= '0' && c <= '9') {
      _ = _ * 10 + c - 48;
      c = gc();
    }
    if (!f) _ = -_;
    return *this;
  }
} io;
int n, a[maxn], answer;
int cur[maxn];
long long cnt = 0;
inline int Epk(const int &key) {
  int p = std::lower_bound(cur + 1, cur + n + 1, key + 1) - cur - 1;
  return p;
}
std::vector<int> buf[8192], Buf[8192];
void Radix_sort(int *ary, int length) {
  for (int i = 0; i < 8192; i++) buf[i].clear(), Buf[i].clear();
  for (int i = 1; i <= length; i++) buf[ary[i] & 8191].push_back(ary[i]);
  for (int i = 0; i < 8192; i++) {
    for (int j = 0; j < (int)buf[i].size(); j++)
      Buf[buf[i][j] >> 13].push_back(buf[i][j]);
  }
  int biz = 0;
  for (int i = 0; i < 8192; i++) {
    for (int j = 0; j < (int)Buf[i].size(); j++) ary[++biz] = Buf[i][j];
  }
}
std::vector<int> posi, nega;
int main() {
  int lim = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) io >> a[i], lim = lim > a[i] ? lim : a[i];
  lim <<= 1;
  for (int i = 0; (1 << i) <= lim; i++) {
    for (int j = 1; j <= n; j++) cur[j] = (a[j] & ((1 << (i + 1)) - 1));
    Radix_sort(cur, n);
    cnt = 0;
    posi.clear(), nega.clear();
    posi.push_back(0), nega.push_back(0);
    for (int j = 1; j <= n; j++) {
      if (cur[j] & (1 << i))
        posi.push_back((1 << i + 1) - cur[j] - 1),
            nega.push_back(((1 << i + 1) - cur[j] - 1 + (1 << i))), cnt += n;
      else
        posi.push_back((1 << i + 1) - cur[j] - 1),
            nega.push_back((1 << i) - cur[j] - 1);
      if ((cur[j] << 1) & (1 << i)) cnt--;
    }
    Radix_sort(posi.data(), posi.size() - 1);
    Radix_sort(nega.data(), posi.size() - 1);
    int p = 1;
    for (int j = 0; j < (int)posi.size(); j++) {
      while (p <= n && cur[p] <= posi[j]) p++;
      cnt += p - 1;
    }
    p = 1;
    for (int j = 0; j < (int)nega.size(); j++) {
      while (p <= n && cur[p] <= nega[j]) p++;
      cnt -= p - 1;
    }
    cnt >>= 1;
    if (cnt & 1) answer += (1 << i);
  }
  printf("%d\n", answer);
  return 0;
}
