#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define debug(x) std::cout << #x << ": " << x << "\n"
#define all(v) v.begin(), v.end()
#define li(i,a,b) for (int (i) = (a); (i) < (b); (i)++)
#define endl '\n'
#define mem(name,val) memset(name,val,sizeof(name))
#define min(a,b) (a<=b ? a : b)
#define max(a,b) (a>=b ? a : b)
//using u64 = uint64_t;
//using u128 = __uint128_t;

class TrieNode {
public:
    TrieNode* child[2]; // 0 1

    TrieNode() {
        child[0] = nullptr;
        child[1] = nullptr;
    }
};

void insert(TrieNode* root, int a) {
    TrieNode* node = root;

    for (int i = 31; i >= 0; --i) {
        int bit = (a >> i) & 1; 
        if (!node->child[bit]) {
            node->child[bit] = new TrieNode();
        }
        node = node->child[bit];
    }
}

int query(TrieNode* root, int a) {
    TrieNode* node = root;
    int maxv = 0;

    for (int i = 31; i >= 0; --i) {
        int bit = (a >> i) & 1;

        if (node->child[1 - bit]) {
            maxv |= (1 << i);           
            node = node->child[1 - bit];
        } else {
            node = node->child[bit];
        }
    }
    return maxv;
}


int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);    

    int n;
    cin>>n;
    int a[n], b[n];
    li(i,0,n) cin>>a[i];
    li(i,0,n) cin>>b[i];

    TrieNode* root = new TrieNode();
    int maxv = 0;
    int pref = 0;

    insert(root, 0);

    li(i,0,n) {
        pref ^= a[i]; 

        int comp = query(root, pref);
        maxv = max(maxv, comp);
        insert(root, pref);
    }

    cout<<maxv;

    return 0;
}