#include <bits/stdc++.h>
using namespace std;
int l[7005][25], a[7005], mi2[7005];
int n, t, k, m;
int minrange(int x, int y) {
  int t = log(y - x + 1) / log(2);
  return min(l[x][t], l[y - (1 << t) + 1][t]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> t;
  while (t--) {
    cin >> n >> m >> k;
    k = min(k, m - 1);
    for (int i = 1; i <= 2 * n; i++) a[i] = 0;
    for (int i = 0; i <= 2 * n; i++)
      for (int j = 0; j <= 20; j++) l[i][j] = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      a[n + i] = a[i];
    }
    if (m == 1) {
      cout << max(a[1], a[n]) << endl;
      continue;
    }
    for (int i = 1; i <= n + 1; i++) mi2[i] = max(a[i], a[i + m]);
    for (int i = 1; i <= n + 1; i++) l[i][0] = mi2[i];
    int h = log(n + 1) / log(2);
    for (int u = 1; u <= h; u++)
      for (int i = 1; i <= n + 1 - (1 << u) + 1; i++)
        l[i][u] = min(l[i][u - 1], l[i + (1 << (u - 1))][u - 1]);
    int kq = 0;
    for (int i = n - k + 1; i <= n + 1; i++) {
      kq = max(kq, minrange(i + k - 1 - m + 1, i - 1));
    }
    cout << kq << endl;
  }
}
