intread(){ int x = 0, f = 0; char c = gc(); while (!isdigit(c)) f |= c == '-', c = gc(); while (isdigit(c)) x = x * 10 + c - '0', c = gc(); return f ? -x : x; }
int n, m, a[maxn], b[maxn];
int A[maxn], B[maxn];
int ans; intmain(){ cin >> n; for (int i = 1; i <= n; ++i) a[i] = read(); for (int i = 1; i <= n; ++i) b[i] = read(); for (int o = 28; ~o; --o) { for (int i = 1; i <= n; ++i) { A[i] = a[i] & (1 << o + 1) - 1; B[i] = b[i] & (1 << o + 1) - 1; } sort(A + 1, A + n + 1, greater<int>()); sort(B + 1, B + n + 1); int l1 = 1, r1 = 0, r = 1, s = 0; for (int i = 1; i <= n; ++i) { while (l1 <= n && B[l1] + A[i] < (1 << o)) ++l1; while (r1 < n && B[r1 + 1] + A[i] < (1 << o + 1)) ++r1; while (r <= n && B[r] + A[i] < (1 << o) + (1 << o + 1)) ++r; s += (r1 - l1 + 1) + (n - r + 1); } if (s & 1) ans += 1 << o; } cout << ans << endl; return0; }