#include <bits/stdc++.h>
long long read() {
  long long res = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) res = res * 10 + ch - 48, ch = getchar();
  return res * flag;
}
void print(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + 48);
}
signed main() {
  long long n = read(), ans = 0;
  n;
  std::vector<long long> a(n + 1), b(n + 1);
  for (long long i = (1); i <= (n); ++i) a[i] = read();
  for (long long i = (1); i <= (n); ++i) b[i] = read();
  for (long long i = (1); i <= (n); ++i)
    for (long long j = (1); j <= (n); ++j) ans ^= (a[i] + b[j]);
  print(ans), puts("");
}
