#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 123, MAXN = 10, MEGAINF = 1e18, C = 100;
signed main() {
  setlocale(LC_ALL, "rus");
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  long long ans = 0;
  for (long long bit = 0; bit < 25; ++bit) {
    vector<long long> cur = a;
    for (long long i = 0; i < n; ++i) cur[i] %= (1 << bit + 1);
    sort(cur.begin(), cur.end());
    long long l1 = (1 << bit), r1 = (1 << bit + 1) - 1;
    long long l2 = (1 << bit + 1) + (1 << bit), r2 = (1 << bit + 2) - 2;
    long long cnt = 0;
    for (long long i = 0; i < n; ++i) {
      long long left1 =
          lower_bound(cur.begin(), cur.end(), l1 - cur[i]) - cur.begin();
      long long right1 =
          upper_bound(cur.begin(), cur.end(), r1 - cur[i]) - cur.begin() - 1;
      left1 = max(left1, i + 1);
      long long add1 = max(0ll, right1 - left1 + 1);
      if (l1 <= r1) cnt += add1;
      long long left2 =
          lower_bound(cur.begin(), cur.end(), l2 - cur[i]) - cur.begin();
      long long right2 =
          upper_bound(cur.begin(), cur.end(), r2 - cur[i]) - cur.begin() - 1;
      left2 = max(left2, i + 1);
      long long add2 = max(0ll, right2 - left2 + 1);
      if (l2 <= r2) cnt += add2;
    }
    if (cnt & 1) ans += (1 << bit);
  }
  cout << ans;
}
