// 河南省实验中学 高中 21级 关天泽
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define re register
const int N = 0x3f3f3f;
using namespace std;
int a[1000050], b[1000050], p, q, n;
int main(){
freopen("XORcipher.in", "r", stdin);
freopen("XORcipher.out", "w", stdout);
cin >> n;
for (int i = 1; i <= n; i++){
cin >> a[i];
p ^= a[i];
}
for (int i = 1; i <= n; i++){
cin >> b[i];
q ^= b[i];
}
cout << (p ^ q);
return 0;
}