#include <bits/stdc++.h>
using namespace std;
vector<long long> v1, v2;
long long N, M, K, Q, T, target;
vector<long long> vl;
vector<vector<long long> > vadj;
vector<long long> st;
long long Seg(long long x, long long y) {
  cout << "SEG" << x << ' ' << y << ' ';
  x += N;
  y += N;
  long long ans = 1;
  while (y > x) {
    if (x % 2 == 1) {
      ans = max(st[x], ans);
      x++;
    } else if (y % 2 == 1) {
      y--;
      ans = max(st[y], ans);
    }
    x /= 2;
    y /= 2;
  }
  cout << ans << endl;
  return ans;
}
long long DP(long long ini, long long fin) {
  if (vadj[ini][fin] != 0) return vadj[ini][fin];
  long long people = ini + N - 1 - fin;
  if (people == (M - 1)) {
    vadj[ini][fin] = max(vl[ini], vl[fin]);
    return vadj[ini][fin];
  }
  long long a1 = DP(ini + 1, fin);
  long long a2 = DP(ini, fin - 1);
  if (people < K) {
    vadj[ini][fin] = max(a1, a2);
  } else
    vadj[ini][fin] = min(a1, a2);
  return vadj[ini][fin];
}
int main() {
  cin >> T;
  for (long long k = 0; k < T; k++) {
    cin >> N >> M >> K;
    vadj.clear();
    vadj.resize(N);
    for (long long i = 0; i < N; i++) vadj[i].resize(N);
    vl.clear();
    vl.resize(N);
    for (long long i = 0; i < N; i++) cin >> vl[i];
    st.clear();
    st.resize(2 * N);
    for (long long i = 0; i < N; i++) st[i + N] = vl[i];
    for (int i = N - 1; i > 0; i--) {
      st[i] = max(st[i * 2], st[i * 2 + 1]);
    }
    K = min(K, M - 1);
    target = M - K - 1;
    cout << DP(0, N - 1) << endl;
  }
}
