#include <bits/stdc++.h>
using namespace std;
clock_t __START, __END;
double __TOTALTIME;
void _MS() { __START = clock(); }
void _ME() {
  __END = clock();
  __TOTALTIME = (double)(__END - __START) / CLOCKS_PER_SEC;
  cout << "Time: " << __TOTALTIME << " s" << endl;
}
const double E = 2.718281828;
const double PI = acos(-1.0);
const long long INF = (1LL << 60);
const int inf = (1 << 30);
const double ESP = 1e-9;
const int mod = (int)1e9 + 7;
const int N = (int)1e6 + 10;
int er[N];
int a[N], b[N];
int get(int n, int x) {
  int pos = 0;
  for (int i = 19; i >= 1; --i) {
    if (pos + er[i] <= n && b[pos + er[i]] <= x) pos += er[i];
  }
  return pos;
}
int main() {
  er[1] = 1;
  for (int i = 2; i <= 30; ++i) er[i] = er[i - 1] * 2;
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  int ans = 0;
  for (int pos = 1; pos <= 25; ++pos) {
    for (int i = 1; i <= n; ++i) b[i] = a[i] & ((1 << pos) - 1);
    sort(b + 1, b + 1 + n);
    long long res = 0;
    for (int i = 1; i <= n; ++i) {
      int now = b[i];
      int l1 = 1 << (pos - 1), r1 = (1 << pos) - 1;
      int l2 = (1 << (pos - 1)) + (1 << pos);
      l1 -= now, r1 -= now;
      l2 -= now;
      int cnt1 = get(n, r1) - get(n, l1 - 1);
      if (now >= l1 && now <= r1) cnt1--;
      int cnt2 = n - get(n, l2 - 1);
      if (now >= l2) cnt2--;
      res += cnt1 + cnt2;
    }
    res /= 2;
    if (res & 1) ans |= 1 << (pos - 1);
  }
  printf("%d\n", ans);
  return 0;
}
