#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int a[N], b[N];
void solve() {
  int n, m, k, ans = 0;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) b[i] = max(a[i], a[i + n - m]);
  k = min(k, m - 1);
  deque<int> q;
  for (int y = 0; y <= m - 1 - k; y++) {
    while (q.size() > 0 && b[y + 1] < b[q.back()]) q.pop_back();
    q.push_back(y + 1);
  }
  ans = b[q.front()];
  for (int x = 1; x <= k; x++) {
    while (q.size() > 0 && q.front() < x + 1) q.pop_front();
    while (q.size() > 0 && b[x + m - k] < b[q.back()]) q.pop_back();
    q.push_back(x + m - k);
    ans = max(ans, b[q.front()]);
  }
  printf("%d\n", ans);
}
int main() {
  int T;
  for (scanf("%d", &T); T; T--) solve();
  return 0;
}
