#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], b[N], tr[N << 2];
void pushup(int x) { tr[x] = min(tr[x << 1], tr[x << 1 | 1]); }
void build(int x, int l, int r) {
  if (l == r) {
    tr[x] = b[l];
    return;
  }
  int mid = l + r >> 1;
  build(x << 1, l, mid);
  build(x << 1 | 1, mid + 1, r);
  pushup(x);
}
int que(int x, int l, int r, int p, int q) {
  if (p <= l && r <= q) return tr[x];
  int mid = l + r >> 1, res = 2e9;
  if (p <= mid) res = min(res, que(x << 1, l, mid, p, q));
  if (q > mid) res = min(res, que(x << 1 | 1, mid + 1, r, p, q));
  return res;
}
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 = 1; i + len - 1 <= n; i++) b[i] = max(a[i], a[i + len - 1]);
  build(1, 1, n);
  for (int i = 0; i <= k; i++) {
    int l = i + 1, r = n - (k - i), cur = que(1, 1, n, l, r - len + 1);
    ans = max(ans, cur);
  }
  write(ans);
  puts("");
}
signed main() {
  int t;
  read(t);
  while (t--) doit();
}
