#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long sum = 0;
  for (long long k = 0; k < 27; k++) {
    long long ans = 0;
    vector<long long> b(n);
    for (long long j = 0; j < n; j++) b[j] = a[j] % (1 << (k + 1));
    sort(b.begin(), b.end());
    for (long long j = 0; j < n; j++) {
      long long l =
          lower_bound(b.begin() + j + 1, b.end(), (1 << k) - b[j]) - b.begin();
      long long r =
          lower_bound(b.begin() + j + 1, b.end(), ((1 << (k + 1)) - b[j])) -
          b.begin();
      ans += (r - l);
      long long left = lower_bound(b.begin() + j + 1, b.end(),
                                   ((1 << (k + 1)) + (1 << k) - b[j])) -
                       b.begin();
      ans += (n - left);
    }
    sum += (ans % 2) * (1 << k);
  }
  cout << sum << "\n";
}
