#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,avx512f")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
signed main() {
  int n;
  cin >> n;
  vector<int> a, b;
  a.reserve(n);
  b.reserve(n);
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    a.emplace_back(t);
  }
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    b.emplace_back(t);
  }
  int ans = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      ans ^= (a[i] + b[j]);
    }
  cout << ans << endl;
}
