#include using namespace std; #define ll long long #define rep(i,a,b) for(ll i = a; i < b; i++) #define REP(i,a,b) for(ll i = a; i <=b; i++) #define fore(i,a) for(auto &i : a) #define all(x) (x).begin(),(x).end() #define fix(i) fixed << setprecision(i) #define nextp(v) next_permutation(all(v)) templatebool chmax(T& a, const T& b) { if(a < b) { a = b; return 1; } return 0; } templatebool chmin(T& a, const T& b) { if(b < a) { a = b; return 1; } return 0; } using pii = pair; using pll = pair; using pq = priority_queue; using pqll = priority_queue; const ll INF = LLONG_MAX/2; const ll MOD = 1000000007; int main() { int N; cin >> N; vector a(N); rep(i,0,N) cin >> a[i]; int Ans = 0; rep(i,0,N-1) rep(j,0,N) { int S = (a[i] ^ a[j]); chmax(Ans, S); } printf("%d\n", Ans); }