#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <cstdlib>
#include <unordered_map>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007 
#define REP(i,n) for(long long i = 0;i < n;++i)
#define seg_size 524288
int main() {
#define int long long
	int n;
	cin >> n;
	vector<long long> a[32], b[32];
	REP(i, n) {
		long long tmp;
		cin >> tmp;
		long long now = 2;
		for (int i = 0; i < 32; ++i) {
			a[i].push_back(tmp % now);
			now *= 2LL;
		}
	}
	REP(q, n) {
		long long tmp;
		cin >> tmp;
		long long now = 2;
		for (int i = 0; i < 32; ++i) {
			b[i].push_back(tmp % now);
			now *= 2LL;
		}
	}
	long long ans = 0;
	long long now_plus = 1;
	for (int i = 0; i < 32; ++i) {
		sort(a[i].begin(), a[i].end());
		sort(b[i].begin(), b[i].end());
		long long geko = 0;
		for (int q = 0; q < a[i].size(); ++q) {
			long long required_min = max(now_plus - a[i][q], 0LL);
			long long required_max = 2 * now_plus - a[i][q] - 1;
			long long bot = 0;
			long long top = n - 1;
			while (top - bot > 1) {
				long long mid = (top + bot) / 2;
				if (b[i][mid] >= required_min) {
					top = mid;
				}
				else bot = mid;
			}
			long long botter = 0;
			if (b[i][bot] >= required_min) {
				botter = bot;
			}
			else if (b[i][top] >= required_min) {
				botter = top;
			}
			else continue;
			bot = 0;
			top = n - 1;
			while (top - bot > 1) {
				long long mid = (top + bot) / 2;
				if (b[i][mid] <= required_max) {
					bot = mid;
				}
				else top = mid;
			}
			if (b[i][top] <= required_max) {
				geko += top - botter + 1;
			}
			else if (b[i][bot] <= required_max) {
				geko += bot - botter + 1;
			}
			if (now_plus < a[i][q]) {
				long long required_min = 3LL * now_plus - a[i][q];
				long long required_max = 2LL*now_plus - 1LL;
				long long bot = 0;
				long long top = n - 1;
				while (top - bot > 1) {
					long long mid = (top + bot) / 2;
					if (b[i][mid] >= required_min) {
						top = mid;
					}
					else bot = mid;
				}
				long long botter = 0;
				if (b[i][bot] >= required_min) {
					botter = bot;
				}
				else if (b[i][top] >= required_min) {
					botter = top;
				}
				else continue;
				bot = 0;
				top = n - 1;
				while (top - bot > 1) {
					long long mid = (top + bot) / 2;
					if (b[i][mid] <= required_max) {
						bot = mid;
					}
					else top = mid;
				}
				if (b[i][top] <= required_max) {
					geko += top - botter + 1;
				}
				else if (b[i][bot] <= required_max) {
					geko += bot - botter + 1;
				}
			}
		}
		if (geko % 2 == 1) {
			ans += now_plus;
		}
		now_plus *= 2;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 111768