object Main extends App {
	val n = scala.io.StdIn.readInt
	val a = scala.io.StdIn.readLine.split(" ").map(_.toLong)
	val b = scala.io.StdIn.readLine.split(" ").map(_.toLong)

	var ans = 0L

	for(i<-0 until n){
		for(j<-0 until n){
			ans = (ans ^ (a(i) + b(j)))
		}
	}

	println(ans)
}