#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <list>
#include <map>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <bitset>
#include <utility>
#include <complex>
#include <assert.h>
#include <limits.h>
//#include <bits/stdc++.h>
using namespace std;
#define rank rankk
#define mp make_pair
#define pb push_back
#define xo(a,b) ((b)&1?(a):0)
#define tm tmp

//#define LL ll
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef long long ll;
typedef pair<ll,int> pli;
typedef pair<int,ll>pil;
typedef pair<ll,ll> pll;
//const double INF=1e20;
const int INF=0x3f3f3f3f;
//const int INF= 0x7fffffff;
//const ll INF=0x3f3f3f3f3f3f3f3fll;
const ll INFF=0x3f3f3f3f3f3f3fll;
//const ll INFF=1e14+5;
const int MAX=2e5+5;
//const ll MAXN=2e8;
//const int MAX_N=MAX;
//const ll MOD=1e9+7;
const int MOD=1e9+7;
//const long double pi=acos(-1.0);
//const double eps=0.00000001;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
template<typename T>inline T abs(T a) {return a>0?a:-a;}
template<class T> inline
void read(T& num) {
    bool start=false,neg=false;
    char c;
    num=0;
    while((c=getchar())!=EOF) {
        if(c=='-') start=neg=true;
        else if(c>='0' && c<='9') {
            start=true;
            num=num*10+c-'0';
        } else if(start) break;
    }
    if(neg) num=-num;
}
inline ll powMM(ll a,ll b,ll M){
    ll ret=1;
    a%=M;
//    b%=M;
    while (b){
        if (b&1) ret=ret*a%M;
        b>>=1;
        a=a*a%M;
    }
    return ret;
}
//const long double eps=-1.0;
//clock_t t1 = clock();
//fprintf(stderr, "%ld ms\n", clock() - t1);
void open()
{
    freopen("in2.txt","r",stdin);
    freopen("out2.txt","w",stdout);
}
int n;
int a[MAX],b[MAX];
vector<int>x[32][3];
int an[32];
int tem;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        tem=a[i];
        int j=0,now=0;
        while(j<=28)
        {
            x[j][tem&1].pb(now);
//            if(j<=3)
//            printf("Now=%d ",now);
            now=now+((tem&1)<<j);

            tem>>=1;
            ++j;
        }
//        printf("\n");
    }
    for(int i=1;i<=28;i++)
        for(int j=0;j<2;j++)if(x[i][j].size())sort(x[i][j].begin(),x[i][j].end());
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&tem);
        an[0]+=x[0][1^(tem&1)].size();
        int j=0;
        int now=0;
//        printf("%d!\n",tem);
//        int now=tem&1;
        while(j<=28)
        {
            now+=((tem&1)<<j);
            tem>>=1;
            ++j;

            int cnt,cnt2;
            cnt=cnt2=0;
            if(x[j][1^(tem&1)].size())
                cnt=lower_bound(x[j][1^(tem&1)].begin(),x[j][1^(tem&1)].end(),(1<<j)-now)-x[j][1^(tem&1)].begin();
            if(x[j][tem&1].size())
                cnt2=x[j][tem&1].size()-(lower_bound(x[j][tem&1].begin(),x[j][tem&1].end(),(1<<j)-now)-x[j][tem&1].begin());
//            if(j<=3)
//            {
//                printf("now=%d tem&1=%d 1^ <%d ==时 >=%d cnt=%d cnt2=%d\n",now,tem&1,(1<<j)-now-1,(1<<j)-now-1,cnt,cnt2);
//            }
            an[j]+=cnt+cnt2;
        }
    }
    int ans=0;
    for(int i=0;i<=28;i++)
    {
        ans+=(an[i]&1)<<i;
    }
    printf("%d\n",ans);
}

/*
6 3
477477

5 100
47477
*/



Measured memory_bytes: 27596