#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair int main() { int n; cin >> n; vector a(n); rep(i,n) cin >> a[i]; int ans = 0; rep(i,n)rep(j,n) ans = max(ans, a[i]^a[j]); cout << ans << endl; }