#include <bits/stdc++.h>
using namespace std;
const long long maxn = 4e5 + 10;
long long a[maxn], b[maxn];
int main() {
  ios::sync_with_stdio(0);
  long long n, ans = 0, mod = 2;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long k = 0; k < 30; k++) {
    long long x = 1 << k;
    long long y = x << 1;
    long long z = x << 2;
    mod = y;
    for (long long i = 1; i <= n; i++) b[i] = a[i] % mod;
    sort(b + 1, b + n + 1);
    long long mid = 0;
    for (long long i = 1; i <= n; i++) {
      mid += lower_bound(b + 1, b + i, (y - b[i])) -
             lower_bound(b + 1, b + i, x - b[i]);
      mid += upper_bound(b + 1, b + i, (z - 2 - b[i])) -
             lower_bound(b + 1, b + i, (y + x - b[i]));
    }
    if (mid & 1) ans += x;
  }
  cout << ans << endl;
}
