#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
long long n,ans;
long long a[N],b[N];
int main(){
freopen("XORcipher.in","r",stdin);
freopen("XORcipher.out","w",stdout);
scanf("%lld",&n);
for(int i = 1;i <= n;i++){
scanf("%d",&a[i]);
ans ^= a[i];
}
for(int i = 1;i <= n;i++){
scanf("%lld",&b[i]);
ans ^= b[i];
}
printf("%lld\n",ans);
return 0;
}