#include <cstdio>
#include <cmath>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <cstring>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

using namespace std;
using lint = long long;

#pragma GCC optimize ("Ofast", "unroll-loops")
#pragma GCC target ("arch=ivybridge")

constexpr int nmax = 204800, block = 4096, unrl = 16;
int a[nmax], b[nmax];

//// FastIn from rsk0315
namespace FastIn {
  static constexpr size_t BUF_SIZE=1<<10, INT_LEN=24, FLT_LEN=400;
  static char buf[BUF_SIZE|1]={}, *pos=buf, *endbuf=nullptr;
  FILE *fin;
 
  inline bool rebuffer() {
    // returns true <=> there is at least one unread character
    size_t rest=endbuf-pos;
    if (buf+rest > pos) {
      // buf[:pos] and buf[-pos:] are overlapping, which std::memcpy()
      // causes undefined behavior.
      return true;
    }
 
    std::memcpy(buf, pos, rest); 
    pos = buf;
    size_t len=std::fread(pos+rest, 1, BUF_SIZE-rest, fin);
    *(endbuf = buf + (rest+len)) = 0;
 
    return *pos;
  }
 
  template <class Int>
  inline bool scan(Int &in) {
    in = 0;
 
    // assume that no redundant whitespace appears
    if (pos + INT_LEN >= endbuf && !rebuffer()) {
      return false;
    }
 
    if (std::is_signed<Int>::value) {
      if (*pos == '-') {
        in = ~*++pos+'1';
        while (*++pos >= '0') {
          in = in*10 + ~*pos+'1';
        }
        ++pos;
        return true;
      }
    }
 
    // assume that numbers are separated by the character whose value is
    // less than '0' (e.g. whitespaces, newlines)
    do {
      in = in*10 + *pos-'0';
    } while (*++pos >= '0');
    ++pos;
    return true;
  }
 
  class Scanner {
    bool rebuffer() {
      return FastIn::rebuffer();
    }
 
  public:
    Scanner(FILE *fin=stdin) {
      FastIn::fin = fin;
      endbuf = pos + std::fread(buf, 1, BUF_SIZE, fin);
    }
 
    template <class T>
    inline bool scan(T &in) {
      return FastIn::scan(in);
    }
 
    template <class First, class... Rest>
    inline bool scan(First &in, Rest &...ins) {
      return scan(in) && scan(ins...);
    }
  };
}
 
FastIn::Scanner cin;

int main() {

	int N;
  	cin.scan(N);
	for (int i = 0; i < N; i++) cin.scan(a[i]);
	for (int i = 0; i < N; i++) cin.scan(b[i]);

	int ans = 0;
	for (int i = 0; i + unrl <= N; i += unrl) {
		for (int j = 0; j + block <= N; j += block) {
			for (int k = j; k < block + j; k++) {

				ans ^= (a[i + 0] + b[k]) ^ (a[i + 1] + b[k]);
				ans ^= (a[i + 2] + b[k]) ^ (a[i + 3] + b[k]);
				ans ^= (a[i + 4] + b[k]) ^ (a[i + 5] + b[k]);
				ans ^= (a[i + 6] + b[k]) ^ (a[i + 7] + b[k]);
              	ans ^= (a[i + 8] + b[k]) ^ (a[i + 9] + b[k]);
				ans ^= (a[i + 10] + b[k]) ^ (a[i + 11] + b[k]);
				ans ^= (a[i + 12] + b[k]) ^ (a[i + 13] + b[k]);
				ans ^= (a[i + 14] + b[k]) ^ (a[i + 15] + b[k]);

			}
		}
	}
	int Nu = N / unrl * unrl;
	for (int i = 0; i < Nu; i++) {
		for (int j = N / block * block; j < N; j++) {
			ans ^= a[i] + b[j];
		}
	}	
	for (int i = Nu; i < N; i++) {
		for (int j = 0; j < N; j++) {
			ans ^= a[i] + b[j];
		}
	}

	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 1792