#include <bits/stdc++.h>
using namespace std;
int bsearch(int x, vector<int> c) {
  int min = 0;
  int max = c.size() - 1;
  int mid;
  while (true) {
    mid = (max + min) / 2;
    if (c[mid] >= x)
      max = mid;
    else
      min = mid + 1;
    if (max <= min) break;
  }
  if (max == c.size() - 1 && c[max] < x) max++;
  return max;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  vector<vector<int>> c;
  c = vector<vector<int>>(29, vector<int>(b.size()));
  for (int k = 0; k < 29; k++) {
    for (int i = 0; i < b.size(); i++) c[k][i] = b[i] % (1 << k + 1);
    sort(c[k].begin(), c[k].end());
  }
  vector<int> bits(29, 0);
  for (int i = 0; i < n; i++) {
    for (int k = 0; k < 29; k++) {
      int l = 0, r = 0;
      int T = 1 << k;
      int ll = bsearch(T - a[i] % (T * 2), c[k]);
      int lr = bsearch(2 * T - a[i] % (T * 2), c[k]);
      if (ll > c[k].size())
        l = 0;
      else if (ll == lr)
        l = 0;
      else
        l = lr - ll;
      int rl = bsearch(3 * T - a[i] % (T * 2), c[k]);
      int rr = bsearch(4 * T - a[i] % (T * 2), c[k]);
      if (rl > c[k].size())
        r = 0;
      else if (rl == rr)
        r = 0;
      else
        r = rr - rl;
      bits[k] += l + r;
    }
  }
  int ans = 0;
  for (int k = 0; k < 29; k++) {
    ans += ((bits[k] % 2) << k);
  }
  cout << ans << endl;
}
