#include <bits/stdc++.h>
using namespace std;
long long rr[] = {0, 1, 1, 1, 0, -1, -1, -1};
long long cc[] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long mod = 1e9 + 7;
const long long N = 300050;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long test = 1;
  while (test--) {
    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 = 30; bit >= 0; bit--) {
      sort(a.begin(), a.end());
      long long cnt = 0;
      for (long long i = 0; i < n - 1; i++) {
        if ((1 << bit) >= a[i] && a[i] < (1 << (bit + 1))) {
          long long x = (1 << bit) - a[i];
          long long y = (1 << (bit + 1)) - 1 - a[i];
          y = upper_bound(a.begin() + i + 1, a.end(), y) - a.begin();
          x = lower_bound(a.begin() + i + 1, a.end(), x) - a.begin();
          cnt += y - x;
        }
        if ((1 << (bit + 1) + (1 << bit)) >= a[i]) {
          long long x = ((1 << bit) + (1 << (bit + 1))) - a[i];
          long long y = (1 << (bit + 2)) - 2 - a[i];
          y = upper_bound(a.begin() + i + 1, a.end(), y) - a.begin();
          x = lower_bound(a.begin() + i + 1, a.end(), x) - a.begin();
          cnt += y - x;
        }
      }
      if (cnt % 2) ans += (1 << bit);
      for (long long i = 0; i < n; i++) {
        a[i] %= (1 << bit);
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
