#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  x = 0;
  char c = getchar();
  bool f = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t>
inline void write(t x) {
  if (x < 0) {
    putchar('-'), write(-x);
  } else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
const int N = 5005;
int a[N];
void doit() {
  int n, m, k, ans = 0;
  read(n);
  read(m);
  read(k);
  k = min(k, m - 1);
  for (int i = 1; i <= n; i++) read(a[i]);
  int len = n - m + 1;
  for (int i = 0; i <= k; i++) {
    int l = i + 1, r = n - (k - i), cur = 2e9;
    for (int j = l; j + len - 1 <= r; j++)
      cur = min(cur, max(a[j], a[j + len - 1]));
    ans = max(ans, cur);
  }
  write(ans);
  puts("");
}
signed main() {
  int t;
  read(t);
  while (t--) doit();
}
