#include <bits/stdc++.h>
using namespace std;
long long power(long long, long long);
long long mpower(long long, long long);
long long BIT[1000009];
long long query(long long);
void update(long long, long long);
map<long long, long long> m;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n + 1);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (long long k = 0; k <= 30; k++) {
    vector<long long> b(n);
    for (long long i = 0; i < n; i++) {
      b[i] = a[i] % (1 << (k + 1));
    }
    sort(b.begin(), b.end());
    long long cnt = 0;
    for (long long i = 0; i < n; i++) {
      long long l =
          lower_bound(b.begin() + i + 1, b.end(), (1 << k) - b[i]) - b.begin();
      long long r =
          lower_bound(b.begin() + i + 1, b.end(), (1 << (k + 1)) - b[i]) -
          b.begin();
      cnt += (r - l);
      l = lower_bound(b.begin() + i + 1, b.end(),
                      (1 << k) + (1 << (k + 1)) - b[i]) -
          b.begin();
      cnt += (n - l);
    }
    ans += (cnt % 2) * (1 << k);
  }
  cout << ans << endl;
  return 0;
}
void update(long long x, long long delta) {
  for (; x < 1000009; x += x & -x) BIT[x] += delta;
}
long long query(long long x) {
  long long sum = 0;
  for (; x > 0; x -= x & -x) sum += BIT[x];
  return sum;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = res * a;
    a = a * a;
    b = b / 2;
  }
  return res;
}
long long mpower(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return res;
}
