#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 1;
const long long M = 101;
const long long mod = 100000;
int a[N], b[N], ans = 0;
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i <= 24; i++) {
    for (int j = 1; j <= n; j++) b[j] = a[j] % (1 << i + 1);
    sort(b + 1, b + 1 + n);
    int dis = 0;
    for (int j = 1; j <= n; j++) {
      int l, r;
      l = lower_bound(b + 1, b + n + 1, (1 << i) - b[j]) - b;
      r = lower_bound(b + 1, b + n + 1, (1 << (i + 1)) - b[j]) - b - 1;
      dis += (r - l + 1);
      l = lower_bound(b + 1, b + n + 1, (1 << i) + (1 << (i + 1)) - b[j]) - b;
      r = lower_bound(b + 1, b + n + 1, (1 << (i + 2)) - b[j]) - b - 1;
      dis += (r - l + 1);
      if ((b[j] + b[j]) & (1 << i)) dis--;
    }
    if ((dis / 2) & 1) ans += 1 << i;
  }
  cout << ans << endl;
}
