Given an array A(A0, A1…. An-1) of n integers. Your task is to find the smallest number larger than a given no. X in the range [l,r] inclusive. Indexing is 0 based. If there is no greater no. than X in the specified range output -1.

For example: A=[1 2 3 8 15 6 7 1 8 7], l=1 and r=5

For X=1 answer should be 2
For X=2, answer should be 3
For X=5, answer should be 6
For X=20, answer should be -1.

Input

First line contains for integers n, l, r and Q, Q denotes no. of queries. Next line contains n integers denoting array A. In the next line, Q space separated integers are given each integer represents the value X for a query.

Output

Print the just largest no. for each query.

Constraints

1 ≤ n ≤ 1000
1 ≤ A[i] ≤ 10^5
1 ≤ X ≤ 10^5
1 ≤ Q ≤ 1000
0 ≤ l, r<n

SAMPLE INPUT
10 1 5 4
1 2 3 8 15 6 7 1 8 7
1 2 5 20

SAMPLE OUTPUT
2
3
6
-1
t=raw_input().split()
s=raw_input().split()
A=[]
B=[]
k=0
k2=0
if len(s)==int(t[0])and int(t[0])>=1 and int(t[0])<=1000:
    l=int(t[1])
    r=int(t[2])
    n=int(t[3])
    for i in range(l,r+1):
        if int(s[i])>=1 and int(s[i])<=pow(10,5):
            A.append(int(s[i]))
        else:
            k+=1
            
    if k==0 and n>=1 and n<=1000 and l>=0:       
        A.sort()
        s2=raw_input().split()
        if len(s2)==n:
            for i in range(0,n):
                if int(s2[i])>=1 and int(s2[i])<=pow(10,5):
                    B.append(int(s2[i]))
                else:
                    k2+=1
        if k2==0:

            for i in range(0,n):
                chk=0
                for j in range(0,len(A)):
                    if A[j]>B[i]:
                        chk=1
                        print(A[j])
                        break
                if chk==0:
                   print(-1)