You and your n - 1 friends have found an array of integers a_1, a_2, ..., a_n. You have decided to share it in the following way: All n of you stand in a line in a particular order. Each minute, the person at the front of the line chooses either the first or the last element of the array, removes it, and keeps it for himself. He then gets out of line, and the next person in line continues the process.

You are standing in the m-th position in the line. Before the process starts, you may choose up to k different people in the line, and persuade them to always take either the first or the last element in the array on their turn (for each person his own choice, not necessarily equal for all people), no matter what the elements themselves are. Once the process starts, you cannot persuade any more people, and you cannot change the choices for the people you already persuaded.

Suppose that you're doing your choices optimally. What is the greatest integer x such that, no matter what are the choices of the friends you didn't choose to control, the element you will take from the array will be greater than or equal to x?

Please note that the friends you don't control may do their choice arbitrarily, and they will not necessarily take the biggest element available.

Input

The input consists of multiple test cases. The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of test cases. The description of the test cases follows.

The first line of each test case contains three space-separated integers n, m and k (1 ≤ m ≤ n ≤ 3500, 0 ≤ k ≤ n - 1) — the number of elements in the array, your position in line and the number of people whose choices you can fix.

The second line of each test case contains n positive integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9) — elements of the array.

It is guaranteed that the sum of n over all test cases does not exceed 3500.

Output

For each test case, print the largest integer x such that you can guarantee to obtain at least x.

Example

Input


4
6 4 2
2 9 2 3 8 5
4 4 1
2 13 60 4
4 1 3
1 2 2 1
2 2 0
1 2


Output


8
4
1
1

Note

In the first test case, an optimal strategy is to force the first person to take the last element and the second person to take the first element.

  * the first person will take the last element (5) because he or she was forced by you to take the last element. After this turn the remaining array will be [2, 9, 2, 3, 8]; 
  * the second person will take the first element (2) because he or she was forced by you to take the first element. After this turn the remaining array will be [9, 2, 3, 8]; 
  * if the third person will choose to take the first element (9), at your turn the remaining array will be [2, 3, 8] and you will take 8 (the last element); 
  * if the third person will choose to take the last element (8), at your turn the remaining array will be [9, 2, 3] and you will take 9 (the first element). 



Thus, this strategy guarantees to end up with at least 8. We can prove that there is no strategy that guarantees to end up with at least 9. Hence, the answer is 8.

In the second test case, an optimal strategy is to force the first person to take the first element. Then, in the worst case, both the second and the third person will take the first element: you will end up with 4.
T = int(input())

import sys; 
from math import ceil,log2; 
  
INT_MAX = sys.maxsize; 
  
# A utility function to get  
# minimum of two numbers  
def minVal(x, y) : 
    return x if (x < y) else y;  
  
# A utility function to get the  
# middle index from corner indexes.  
def getMid(s, e) : 
    return s + (e - s) // 2;  
  
""" A recursive function to get the  
minimum value in a given range  
of array indexes. The following  
are parameters for this function.  
  
    st --> Pointer to segment tree  
    index --> Index of current node in the  
        segment tree. Initially 0 is  
        passed as root is always at index 0  
    ss & se --> Starting and ending indexes  
                of the segment represented  
                by current node, i.e., st[index]  
    qs & qe --> Starting and ending indexes of query range """
def RMQUtil( st, ss, se, qs, qe, index) : 
  
    # If segment of this node is a part  
    # of given range, then return  
    # the min of the segment  
    if (qs <= ss and qe >= se) : 
        return st[index];  
  
    # If segment of this node  
    # is outside the given range  
    if (se < qs or ss > qe) : 
        return INT_MAX;  
  
    # If a part of this segment  
    # overlaps with the given range  
    mid = getMid(ss, se);  
    return minVal(RMQUtil(st, ss, mid, qs,  
                          qe, 2 * index + 1),  
                  RMQUtil(st, mid + 1, se, 
                          qs, qe, 2 * index + 2));  
  
# Return minimum of elements in range  
# from index qs (query start) to  
# qe (query end). It mainly uses RMQUtil()  
def RMQ( st, n, qs, qe) :  
  
    # Check for erroneous input values  
    if (qs < 0 or qe > n - 1 or qs > qe) : 
      
        print("Invalid Input");  
        return -1;  
      
    return RMQUtil(st, 0, n - 1, qs, qe, 0);  
  
# A recursive function that constructs  
# Segment Tree for array[ss..se].  
# si is index of current node in segment tree st  
def constructSTUtil(arr, ss, se, st, si) : 
  
    # If there is one element in array,  
    # store it in current node of  
    # segment tree and return  
    if (ss == se) : 
  
        st[si] = arr[ss];  
        return arr[ss];  
  
    # If there are more than one elements,  
    # then recur for left and right subtrees  
    # and store the minimum of two values in this node  
    mid = getMid(ss, se);  
    st[si] = minVal(constructSTUtil(arr, ss, mid, 
                                    st, si * 2 + 1), 
                    constructSTUtil(arr, mid + 1, se, 
                                    st, si * 2 + 2));  
      
    return st[si];  
  
"""Function to construct segment tree  
from given array. This function allocates  
memory for segment tree and calls constructSTUtil() 
to fill the allocated memory """
def constructST( arr, n) : 
  
    # Allocate memory for segment tree  
  
    # Height of segment tree  
    x = (int)(ceil(log2(n)));  
  
    # Maximum size of segment tree  
    max_size = 2 * (int)(2**x) - 1;  
   
    st = [0] * (max_size);  
  
    # Fill the allocated memory st  
    constructSTUtil(arr, 0, n - 1, st, 0);  
  
    # Return the constructed segment tree  
    return st;  
  

def solve():
    [N,M,K] = list(map(int,input().split()))
    A = list(map(int,input().split()))

    st = constructST(A, N)

    sal = len(A)-K
    sal = max(sal, len(A)-M+1)

#    print("sal",sal)
    ans = -float('inf')
    qs = 0
    qe = sal-1

    edge = max(1,M-K-1)
#    print("edge",edge)
    while qe < len(A):
        foo = A[qs:qe+1]
#        print(foo)
#        print(foo[:edge])
#        print(foo[-edge:])
#        print(min(min(foo[:edge]), min(foo[-edge:])))
        ans = max(ans,min(min(foo[:edge]), min(foo[-edge:])))

        #ans = max(ans, RMQ(st,N,qs, qs+edge))
        #ans = max(ans, RMQ(st,N,qe, qe+edge))
        qs += 1
        qe += 1
    return ans

for _ in range(T):
    print(solve())
