#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
vector<int> a(200001), b(200001);
int finalres = 0;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (int j = 1; j <= 29; j++) {
    int k = (1 << j);
    k >>= 1;
    int MOD_NUM = k << 1;
    vector<int> tmpa, tmpb;
    tmpa = a;
    tmpb = b;
    for (int i = 1; i <= n; i++) {
      tmpa[i] %= MOD_NUM;
      tmpb[i] %= MOD_NUM;
    }
    sort(tmpa.begin() + 1, tmpa.begin() + 1 + n);
    sort(tmpb.begin() + 1, tmpb.begin() + 1 + n);
    long long tmpres = 0;
    for (int i = 1; i <= n; i++) {
      vector<int>::iterator ite =
          lower_bound(tmpb.begin() + 1, tmpb.begin() + 1 + n, k - tmpa[i]);
      if (ite == tmpb.begin() + 1 + n) continue;
      vector<int>::iterator ite2 =
          lower_bound(tmpb.begin() + 1, tmpb.begin() + 1 + n, 2 * k - tmpa[i]) -
          1;
      tmpres += (ite2 - ite + 1);
    }
    for (int i = 1; i <= n; i++) {
      vector<int>::iterator ite =
          lower_bound(tmpb.begin() + 1, tmpb.begin() + 1 + n, 3 * k - tmpa[i]);
      if (ite == tmpb.begin() + 1 + n) continue;
      vector<int>::iterator ite2 =
          lower_bound(tmpb.begin() + 1, tmpb.begin() + 1 + n, 4 * k - tmpa[i]) -
          1;
      tmpres += (ite2 - ite + 1);
    }
    if (tmpres & 1) {
      finalres += k;
    }
  }
  cout << finalres << endl;
  return 0;
}
