#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 7;
const int mod = 1e9 + 7;
const long long INF = 1e18;
int a[maxn], b[maxn];
void rua() {
  int n, ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < 28; i++) {
    for (int j = 1; j <= n; j++) b[j] = a[j] % (1 << (1 + i));
    sort(b + 1, b + 1 + n);
    long long num = 0;
    for (int j = 1; j <= n; j++) {
      long long res =
          lower_bound(b + 1, b + 1 + n, (1 << (i + 1)) + (1 << i) - b[j]) - b -
          1;
      num += n - res;
      if (2 * b[j] >= (1 << (i + 1)) + (1 << i)) num--;
      long long s1 = lower_bound(b + 1, b + 1 + n, (1 << i) - b[j]) - b - 1;
      long long s2 =
          upper_bound(b + 1, b + 1 + n, (1 << (i + 1)) - b[j] - 1) - b - 1;
      num += (s2 - s1);
      if (2 * b[j] >= (1 << i) && 2 * b[j] < (1 << (i + 1))) num--;
    }
    num >>= 1;
    if (num & 1) ans += (1 << i);
  }
  printf("%d\n", ans);
}
int main() {
  rua();
  return 0;
}
