function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	//input = input.trim().split(" ");
	input = input.trim().split("\n");
	//input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  var N = parseInt(input[0]);
  var aList = input[1].split(" ").map((a)=>Number(a));
  var bList = input[2].split(" ").map((a)=>Number(a));
  var ruiseki = new Array(400000).fill(0);
  for(var i = 0; i < N; i++){
    for(var j = 0; j < N; j++){
      ruiseki[aList[i] + bList[j]]++;
    }
  }
  var output = 0;
  for(var i = 1; i < 400000; i++){
    if(ruiseki[i] % 2 == 1){
       output = output ^ i;
       }
  }
  myout(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
