Bike loves looking for the second maximum element in the sequence. The second maximum element in the sequence of distinct numbers *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*k*</sub> (*k* &gt; 1) is such maximum element *x*<sub class="lower-index">*j*</sub>, that the following inequality holds: <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/41e9a774451aa769280692592b29103e0a6ecf97.png" style="max-width: 100.0%;max-height: 100.0%;"/>.

The lucky number of the sequence of distinct positive integers *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*k*</sub> (*k* &gt; 1) is the number that is equal to the bitwise excluding OR of the maximum element of the sequence and the second maximum element of the sequence.

You've got a sequence of distinct positive integers *s*<sub class="lower-index">1</sub>, *s*<sub class="lower-index">2</sub>, ..., *s*<sub class="lower-index">*n*</sub> (*n* &gt; 1). Let's denote sequence *s*<sub class="lower-index">*l*</sub>, *s*<sub class="lower-index">*l* + 1</sub>, ..., *s*<sub class="lower-index">*r*</sub> as *s*[*l*..*r*] (1 ≤ *l* &lt; *r* ≤ *n*). Your task is to find the maximum number among all lucky numbers of sequences *s*[*l*..*r*].

Note that as all numbers in sequence *s* are distinct, all the given definitions make sence.
The first line contains integer *n* (1 &lt; *n* ≤ 10<sup class="upper-index">5</sup>). The second line contains *n* distinct integers *s*<sub class="lower-index">1</sub>, *s*<sub class="lower-index">2</sub>, ..., *s*<sub class="lower-index">*n*</sub> (1 ≤ *s*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
import math
def xor(a,b):
    i=0
    j=0
    a1=0
    b1=0
    while(a>=1):
        (a1)=int(a1)+(int(a)%2)*(pow(10,i))
        a=a/2
        i=i+1
    while(b>=1):
        b1=int(b1)+(int(b)%2)*(pow(10,j))
        b=b/2
        j=j+1
    k=a1+b1
    l=0
    i=0
    while(k>0):
        p=k%10
        if(p==2):
            p=0
        l=l+(p*pow(10,i))
        k=int(k/10)
        i=i+1
    x=0
    i=0
    while(l>0):
        x=x+(l%10)*pow(2,i)
        l=int(l/10)
        i=i+1
    return x
def maximum(ar):

    i=1
    maxar=ar[0]
    while(i<len(ar)):
        if(maxar<ar[i]):
            maxar=ar[i]
        i=i+1
    return maxar
def secmaximum(arra):
    i=1
    secmaxar=arra[0]
    while(i<len(arra)):
        if((secmaxar<arra[i] or secmaxar>=maximum(arra)) and (arra[i]!=maximum(arra))):
            secmaxar=arra[i]
        i=i+1
    return secmaxar
def secarray(arr):
    ar2=[]

    i=0
    while(i<len(arr)):
        if(arr[i]==maximum(arr)):
            break
        i=i+1
    k=1
    while(k<len(arr)-i):
        ar2.append(k)
        k=k+1
    j=0
    while(j<len(arr)-i-1):
        ar2[j]=arr[j+i+1]
        j=j+1
    return ar2
array=[]
num=int(input(""))
i=0
while(i<num):
    x=int(input(""))
    array.append(x)
    i=i+1

k1=int(secmaximum(secarray(array)))
k2=int(maximum(secarray(array)))
print(xor(k1,k2))
