#include <bits/stdc++.h>
int p[4000];
int que[4000], quei[4000], t;
int i, j, n, m, k;
int mymax(int a, int b) { return a > b ? a : b; }
int mymin(int a, int b) { return a < b ? a : b; }
int main() {
  int nn;
  scanf("%d", &nn);
  while (nn--) {
    scanf("%d %d %d", &n, &m, &k);
    for (i = 1; i <= n; i++) {
      scanf("%d", &p[i]);
    }
    for (i = 1; i <= m; i++) {
      p[i] = mymax(p[i], p[i + n - m]);
    }
    if (k > m - 1) k = m - 1;
    int allans = -1;
    for (j = 1, t = 0; j <= m - k; j++) {
      while (t >= 1 && que[t] >= p[j]) {
        t--;
      }
      t++;
      que[t] = p[j];
      quei[t] = j;
    }
    allans = que[1];
    int start = 1;
    for (i = 1 + m - k; i <= m; i++) {
      while (quei[start] < i - m + k + 1 && start <= t) {
        start++;
      }
      while (t >= start && que[t] >= p[i]) {
        t--;
      }
      t++;
      que[t] = p[i];
      quei[t] = i;
      if (que[start] > allans) allans = que[start];
    }
    printf("%d\n", allans);
  }
  return 0;
}
