#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T1, class T2>
ostream& operator<<(ostream& s, pair<T1, T2> P) {
  return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream& operator<<(ostream& s, vector<T> P) {
  for (int i = 0; i < P.size(); ++i) {
    if (i > 0) {
      s << " ";
    }
    s << P[i];
  }
  return s;
}
template <class T>
ostream& operator<<(ostream& s, vector<vector<T> > P) {
  for (int i = 0; i < P.size(); ++i) {
    s << endl << P[i];
  }
  return s << endl;
}
template <class T>
ostream& operator<<(ostream& s, set<T> P) {
  for (auto it : P) {
    s << "<" << it << "> ";
  }
  return s << endl;
}
template <class T1, class T2>
ostream& operator<<(ostream& s, map<T1, T2> P) {
  for (auto it : P) {
    s << "<" << it.first << "->" << it.second << "> ";
  }
  return s << endl;
}
const int INF = 1 << 30;
int MAX_DIGIT = 25;
int N;
vector<int> a;
int solve() {
  long long res = 0;
  for (int d = MAX_DIGIT - 1; d >= 0; --d) {
    sort(a.begin(), a.end());
    vector<int> zero, one;
    for (int i = 0; i < N; ++i) {
      if (a[i] & (1 << d))
        one.push_back(a[i] - (1 << d));
      else
        zero.push_back(a[i]);
    }
    long long num = 0;
    for (int i = 0; i < zero.size(); ++i) {
      int id = lower_bound(zero.begin(), zero.end(), (1 << d) - zero[i]) -
               zero.begin();
      chmax(id, i + 1);
      num += N - id;
      id =
          lower_bound(one.begin(), one.end(), (1 << d) - zero[i]) - one.begin();
      num += id;
    }
    for (int i = 0; i < one.size(); ++i) {
      int id =
          lower_bound(one.begin(), one.end(), (1 << d) - one[i]) - one.begin();
      chmax(id, i + 1);
      num += N - id;
    }
    if (num % 2 == 1) res += (1 << d);
    for (int i = 0; i < N; ++i) {
      if (a[i] & (1 << d)) a[i] -= (1 << d);
    }
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  while (cin >> N) {
    a.resize(N);
    for (int i = 0; i < N; ++i) cin >> a[i];
    cout << solve() << endl;
  }
}
