#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> dp;
long long fx(vector<long long> &a, int l, int r, int turn, int k, int m) {
  if (turn == m) return dp[l][r] = max(a[l], a[r]);
  if (dp[l][r] != -1) return dp[l][r];
  long long x = fx(a, l + 1, r, turn + 1, k, m);
  long long y = fx(a, l, r - 1, turn + 1, k, m);
  return dp[l][r] = ((turn <= k) ? max(x, y) : min(x, y));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t, n, m, i, j, k;
  cin >> t;
  while (t--) {
    cin >> n >> m >> k;
    vector<long long> a(n);
    dp.clear();
    dp.resize(n, vector<long long>(n, -1));
    for (int i = 0; i < n; ++i) cin >> a[i];
    cout << fx(a, 0, n - 1, 1, k, m) << "\n";
  }
  return 0;
}
