#include <bits/stdc++.h>
#pragma GCC optimize("O3")
int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  int N;
  scanf("%d", &N);
  std::vector<int> A(N, 0);
  std::vector<int> B(N, 0);
  for (int i = 0; i < N; ++i) scanf("%d", &A[i]);
  for (int i = 0; i < N; ++i) scanf("%d", &B[i]);
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      ans ^= A[i] + B[j];
    }
  }
  printf("%d\n", ans);
  return 0;
}
