#include <bits/stdc++.h>
using namespace std;
int gi() {
  int a;
  scanf("%d", &a);
  return a;
}
long long gli() {
  long long a;
  scanf("%I64d", &a);
  return a;
}
int a[3500];
int getl(map<int, int> m) {
  while (m.begin()->second == 0) m.erase(m.begin());
  return m.begin()->first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = gi();
  while (t--) {
    int n = gi();
    int m = gi();
    int k = gi();
    for (int i = 0; i < n; i++) a[i] = gi();
    if (k >= m - 1) {
      int mx = a[0];
      for (int i = 0; i < m; i++) {
        mx = ((mx) > (a[i]) ? (mx) : (a[i]));
        mx = ((mx) > (a[n - 1 - i]) ? (mx) : (a[n - 1 - i]));
      }
      printf("%d\n", mx);
      continue;
    }
    map<int, int> mp;
    int d = n - m;
    for (int e = d; e <= n - 1 - k; e++) {
      int v = ((a[e - d]) > (a[e]) ? (a[e - d]) : (a[e]));
      mp[v]++;
    }
    int res = getl(mp);
    for (int s = 0, e = n - k; e < n; e++, s++) {
      int vo = ((a[s]) > (a[s + d]) ? (a[s]) : (a[s + d]));
      mp[vo]--;
      int v = ((a[e - d]) > (a[e]) ? (a[e - d]) : (a[e]));
      mp[v]++;
      int alt = getl(mp);
      res = ((res) > (alt) ? (res) : (alt));
    }
    printf("%d\n", res);
  }
  return 0;
}
