#include <bits/stdc++.h>

using namespace std;

const int N = (int)2e5;
const int MAX_LEN = 30;
int a[N + 10];
int b[N + 10];
int a2[N + 10];
int b2[N + 10];

int main() {
    int n;
    cin >> n;
    for(int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for(int i = 0; i < n; ++i) {
        cin >> b[i];
    }
    long long sum = 0;
    for(int i = 0; i <= MAX_LEN; ++i) {
        int mod = 1 << (i + 1);
        for(int j = 0; j < n; ++j) {
            a2[j] = a[j] % mod;
            b2[j] = b[j] % mod;
        }
        // for(int j = 0; j < n; ++j) {
        //     cout << a2[j] << " ";
        // }
        // cout << endl;
        sort(b2, b2 + n);
        // for(int j = 0; j < n; ++j) {
        //     cout << b2[j] << " ";
        // }
        // cout << endl;
        // cout << endl;
        int cnt = 0;
        for(int j = 0; j < n; ++j) {
            int low_bound = 1 << i;
            int up_bound = 1 << (i + 1);
            int left = 0;
            int right = n - 1;
            int start = -1;
            int end = -1;
            while(left <= right) {
                int middle = left + (right - left) / 2;
                if(b2[middle] + a2[j] < up_bound) {
                    end = middle;
                    left = middle + 1;
                } else {
                    right = middle - 1;
                } 
            }
            left = 0;
            right = n - 1;
            while(left <= right) {
                int middle = left + (right - left) / 2;
                if(b2[middle] + a2[j] >= low_bound) {
                    start = middle;
                    right = middle - 1;
                } else {
                    left = middle + 1;
                }
            }
            if(end != -1 and start != -1) {
                cnt += (end - start + 1);
            }
            // cout << i << " " << j << " " << low_bound << " " << up_bound << " " << start << " " << end << " " << cnt << " "<< " " << low_bound << " " << up_bound << endl;
            left = 0;
            right = n - 1;
            start = -1;
            end = -1;
            low_bound = (1 << i) * 3;
            up_bound = (1 << i) * 4;
            while(left <= right) {
                int middle = left + (right - left) / 2;
                if(b2[middle] + a2[j] < up_bound) {
                    end = middle;
                    left = middle + 1;
                } else {
                    right = middle - 1;
                }
            }
            left = 0;
            right = n - 1;
            while(left <= right) {
                int middle = left + (right - left) / 2;
                if(b2[middle] + a2[j] >= low_bound) {
                    start = middle;
                    right = middle - 1;
                } else {
                    left = middle + 1;
                }
            }
            if(end != -1 and start != -1) {
                cnt += (end - start + 1);
            }
            // cout << i << " " << j << " " << low_bound << " " << up_bound << " " << start << " " << end << " " << cnt << " "<< " " << low_bound << " " << up_bound << endl;
            // sum += (1 << i) * cnt;
        }
        if(cnt & 1) {
            sum += (1 << i);
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3328