#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() int main() { cin.tie(nullptr); int N; cin >> N; vector A(N); rep(i, 0, N) cin >> A[i]; ll ans = -1; rep(i, 0, N - 1) rep(j, i + 1, N) ans = max(ans, A[i] ^ A[j]); cout << ans << '\n'; }