#include <bits/stdc++.h>
using namespace std;
const int MAX = 3500 + 10;
int n, m, k;
int a[MAX], dp[MAX][MAX];
int check(int l, int r, int left) {
  if (!left) {
    return max(a[l], a[r]);
  }
  int &ret = dp[l][r];
  if (~ret) return ret;
  if (m - left + 1 > k)
    return ret = min(check(l + 1, r, left - 1), check(l, r - 1, left - 1));
  else {
    return ret = max(check(l + 1, r, left - 1), check(l, r - 1, left - 1));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> m >> k;
    for (int i = 0; i < n; i++) cin >> a[i];
    m--;
    int ans = 0;
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= n; j++) dp[i][j] = -1;
    ans = check(0, n - 1, m);
    cout << ans << endl;
  }
}
