#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int main() {
  int n;
  scanf("%d", &n);
  vector<long long> a(n), b(n);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &a[i]);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &b[i]);
  }
  long long ans = 0;
  for (int bit = 0; bit < 30; ++bit) {
    long long T = (1 << bit);
    vector<long long> bb(n);
    for (int i = 0; i < n; ++i) {
      bb[i] = b[i] % (2 * T);
    }
    sort(bb.begin(), bb.end());
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
      long long val = a[i] % (2 * T);
      cnt += (int)(upper_bound(bb.begin(), bb.end(), 2 * T - val - 1) -
                   lower_bound(bb.begin(), bb.end(), T - val));
      cnt += (int)(upper_bound(bb.begin(), bb.end(), 4 * T - val - 1) -
                   lower_bound(bb.begin(), bb.end(), 3 * T - val));
    }
    if (cnt % 2) {
      ans |= (1 << bit);
    }
  }
  printf("%lld\n", ans);
  return 0;
}
