#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int arr[4000];
int solve(int i, int l, int r, vector<vector<int> >& dp) {
  if (dp[l][r]) return dp[l][r];
  int lr;
  if (i == m || l == r) return max(arr[l], arr[r]);
  if (i > k)
    lr = min(solve(i + 1, l + 1, r, dp), solve(i + 1, l, r - 1, dp));
  else
    lr = max(solve(i + 1, l + 1, r, dp), solve(i + 1, l, r - 1, dp));
  dp[l][r] = lr;
  return dp[l][r];
}
int main() {
  {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  int n, t;
  cin >> t;
  while (t--) {
    cin >> n >> m >> k;
    vector<vector<int> > v(n + 5);
    vector<int> v1(n + 5, 0);
    for (int i = 0; i < (n); i++) cin >> arr[i], v[i] = v1;
    cout << solve(1, 0, n - 1, v) << endl;
  }
  return 0;
}
