#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  long long int r, i;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long int power(long long int x, long long int y, long long int mod) {
  long long int temp, ty, my;
  if (y == 0) return 1;
  temp = power(x, y / 2, mod);
  ty = (temp % mod) * (temp % mod);
  if (y % 2 == 0) {
    return ty % mod;
  } else {
    my = (x % mod) * (ty % mod);
    return my % mod;
  }
}
long long int mycbrt(long long int n) {
  long long int start = 0;
  long long int end = 1000000LL;
  long long int ans = -1;
  while (start <= end) {
    long long int mid = (start + end) / 2;
    if ((mid * mid * mid) > n)
      end = mid - 1;
    else if ((mid * mid * mid) == n) {
      ans = mid;
      break;
    } else {
      start = mid + 1;
    }
  }
  if (n == 1) {
    ans = 1;
  }
  return ans;
}
void SieveOfEratosthenes(int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) cout << p << " ";
}
struct abhi {
  long long int val1;
  long long int val2;
  long long int po;
};
bool cmp(struct abhi x, struct abhi y) {
  if (x.val1 == y.val1) return x.val2 < y.val2;
  return x.val1 < y.val1;
}
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
vector<pair<long long int, long long int> > po;
long long int ar[1000010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, i, d, j, k;
  string s, t;
  cin >> n;
  for (i = (0); i < (n); i++) {
    cin >> ar[i];
  }
  long long int ans = 0;
  for (i = (0); i < (30); i++) {
    vector<long long int> bc;
    long long int num = 1 << (i + 1);
    for (j = (0); j < (n); j++) {
      bc.push_back(ar[j] % num);
    }
    sort(bc.begin(), bc.end());
    long long int totalPairsWithBitSet = 0;
    for (j = (0); j < (n); j++) {
      long long int lef =
          lower_bound(bc.begin() + j + 1, bc.end(), (1 << i) - bc[j]) -
          bc.begin();
      long long int rig = upper_bound(bc.begin() + j + 1, bc.end(),
                                      (1 << (i + 1)) - bc[j] - 1) -
                          bc.begin();
      totalPairsWithBitSet += (rig - lef);
      lef = lower_bound(bc.begin() + j + 1, bc.end(),
                        (1 << (i + 1)) + (1 << i) - bc[j]) -
            bc.begin();
      rig = n;
      totalPairsWithBitSet += (rig - lef);
    }
    ans += (totalPairsWithBitSet % 2) ? (1 << i) : 0;
  }
  cout << ans << "\n";
  return 0;
}
