#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int N = 4e5 + 10;
const int M = 1e6 + 10;
const int mod = 1000000007;
const double eps = 1e-10;
const double pi = acos(-1.0);
int n;
int a[N], b[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int ans = 0;
  for (int k = 0; k < 26; k++) {
    for (int i = 1; i <= n; i++) b[i] = a[i] % (1 << (k + 1));
    sort(b + 1, b + 1 + n);
    int l = n, r = n, p = n;
    long long res = 0;
    for (int i = 1; i <= n; i++) {
      while (l && b[l] + b[i] >= (1 << k)) l--;
      while (r && b[r] + b[i] >= (1 << (k + 1))) r--;
      while (p && b[p] + b[i] >= (1 << (k + 1)) + (1 << k)) p--;
      res += r - l;
      res += n - p;
      if ((l < i && i <= r) || i > p) res--;
    }
    res >>= 1;
    if (res & 1) ans |= 1 << k;
  }
  cout << ans << '\n';
  return 0;
}
