#include <bits/stdc++.h>
long a[200000];
long b[200000];
long b_rem_sort[28][200000];
using namespace std;
int main() {
  int N;
  int xors[200000] = {0};
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < N; i++) {
    cin >> b[i];
    long pow2 = 1;
    for (int j = 0; j < 28; j++) {
      pow2 *= 2;
      b_rem_sort[j][i] = b[i] % pow2;
    }
  }
  for (int j = 0; j < 28; j++) {
    sort(b_rem_sort[j], b_rem_sort[j] + N);
  }
  long pow2 = 1;
  for (int j = 0; j < 28; j++) {
    pow2 *= 2;
    for (int i = 0; i < N; i++) {
      int bound1, bound2, bound3;
      long a_rem;
      a_rem = a[i] % pow2;
      bound1 = lower_bound(b_rem_sort[j], b_rem_sort[j] + N, pow2 / 2 - a_rem) -
               b_rem_sort[j];
      bound2 = lower_bound(b_rem_sort[j], b_rem_sort[j] + N, pow2 - a_rem) -
               b_rem_sort[j];
      bound3 = lower_bound(b_rem_sort[j], b_rem_sort[j] + N,
                           pow2 / 2 + pow2 - a_rem) -
               b_rem_sort[j];
      xors[j] = (xors[j] + bound2 - bound1 + N - bound3) % 2;
    }
  }
  long ret = 0;
  pow2 = 1;
  for (int j = 0; j < 28; j++) {
    ret += xors[j] * pow2;
    pow2 *= 2;
  }
  cout << ret << '\n';
}
