"use strict";
function binarySearch(array, value) {
    let start = 0;
    let stop = array.length - 1;
    let middle = Math.floor((start + stop) / 2);
    while (array[middle] !== value && start < stop) {
        if (value < array[middle]) {
            stop = middle - 1;
        } else {
            start = middle + 1;
        }
        middle = Math.floor((start + stop) / 2);
    }
    return (array[middle] !== value) ? -1 : middle;
}
function Main(input) {
    let cin = new Inputer(input);
    let N = cin.getInt(), A = cin.getIntArray(N), B = cin.getIntArray(N);
    let a = new Array(N), b = new Array(N);
    let ans = 0;
    for (let i = 0; i < 30; ++i) {
        let T2 = 1 << (i + 1);
        let T = 1 << i;
        for (let j = 0; j < N; ++j) {
            a[j] = A[j] % T2;
            b[j] = B[j] % T2;
        }
        B.sort((a, b) => a - b);
        let cnt = 0;
        for (let n = 0; n < N; n++) {
            let x = a[n];
            let k1 = binarySearch(b, T - x) - b[0];
            let k2 = binarySearch(b, 2 * T - x) - b[0];
            let k3 = binarySearch(b, 3 * T - x) - b[0];
            cnt += k2 - k1 + N - k3;
        }
        if (cnt & 1) {
            ans += T;
        }
    }
    console.log(ans);
}
class Inputer{constructor(t){if(typeof t=='undefined')throw new Error('引数（stdin）を省略できません！');this.cnt=0,this.items=t.split(/\n|\s/)}getInt(){return this.items[this.cnt++]-0}getIntArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getInt();return r}getStr(){return this.items[this.cnt++]}getStrArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getStr();return r}}
if (typeof window == "undefined") Main(require("fs").readFileSync("/dev/stdin", "utf8"));