#include <bits/stdc++.h>
using namespace std;
void see(int x) { cout << x; }
void see(long long int x) { cout << x; }
void see(long double x) { cout << x; }
void see(char x) { cout << '\'' << x << '\''; }
void see(string x) { cout << '\"' << x << '\"'; }
template <typename T, typename V>
void see(const pair<T, V> &x) {
  cout << '{';
  see(x.first);
  cout << ',';
  see(x.second);
  cout << '}';
}
template <typename T>
void see(const T &x) {
  int f = 0;
  cout << '{';
  for (auto &i : x) cout << (f++ ? "," : ""), see(i);
  cout << "}";
}
void _print() { cout << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  see(t);
  if (sizeof...(v)) cout << ", ";
  _print(v...);
}
long long int gcd(long long int a, long long int b) {
  return (!b) ? a : gcd(b, a % b);
}
void solve() {
  int n;
  cin >> n;
  vector<int> a;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  long long int ans = 0;
  for (int k = 0; k <= 26; k++) {
    vector<int> b;
    for (int i = 0; i <= n - 1; i++) b.push_back(a[i] % (1 << (k + 1)));
    sort(b.begin(), b.end());
    long long int cnt = 0;
    for (int i = 0; i <= n - 1; i++) {
      int l =
          lower_bound(b.begin() + i + 1, b.end(), (1 << k) - b[i]) - b.begin();
      int 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)) + (1 << k) - b[i]) -
          b.begin();
      cnt += n - l;
    }
    ans += (cnt & 1) * 1ll * (1 << k);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
}
