#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[4000];
int b[4000];
int q[4000];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m, k;
    cin >> n >> m >> k;
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    int mx = 0;
    int aa = -1, bb = n + 1;
    int tt = 0;
    for (int i = 0; i <= m - 1; i++) {
      b[++tt] = max(a[i + 1], a[n + 1 - (m - i)]);
      mx = max(mx, b[tt]);
    }
    if (k >= m - 1) {
      cout << mx << endl;
    } else {
      for (int i = 1; i <= tt; i++) {
      }
      int mm = 0;
      int hh = 1, tot = 0;
      int dis = m - k;
      for (int i = 1; i <= tt; i++) {
        if (hh <= tot && q[hh] < i - dis + 1) hh++;
        while (hh <= tot && b[q[tot]] >= b[i]) tot--;
        q[++tot] = i;
        if (i >= dis) {
          mm = max(mm, b[q[hh]]);
        }
      }
      cout << mm << endl;
    }
  }
  return 0;
}
