#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,fast-math")
using namespace std;
const long long N = 4e3 + 100, OO = 1e12 + 100, M = 998244353, P = 6151,
                SQ = 120, lg = 28;
long long a[N];
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  if (k >= m - 1) {
    long long ans = 0;
    for (long long i = 0; i < m; i++) ans = max(ans, a[i]);
    for (long long i = n - 1; i >= n - m; i--) ans = max(ans, a[i]);
    cout << ans << endl;
    return;
  }
  long long h = m - k - 1, ans = 0;
  for (long long i = 0; i <= k; i++) {
    long long t = OO;
    for (long long j = 0; j <= h; j++) {
      t = min(t, max(a[i + j], a[n - (k - i) - 1 - (h - j)]));
    }
    ans = max(ans, t);
  }
  cout << ans << endl;
  return;
}
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
