#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> A(n);
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
  }
  int x = min(k, m - 1);
  int y = m - 1 - x;
  vector<int> b;
  for (int i = 0; i + n - m < n; ++i) {
    b.push_back(max({A[i], A[i + n - m]}));
  }
  deque<int> dq;
  for (int i = 0; i <= y; ++i) {
    while (!dq.empty() && b[dq.back()] >= b[i]) {
      dq.pop_back();
    }
    dq.push_back(i);
  }
  int ans = b[dq.front()];
  for (int i = y + 1; i <= m - 1; ++i) {
    while (!dq.empty() && b[dq.back()] >= b[i]) {
      dq.pop_back();
    }
    while (!dq.empty() && dq.front() <= i - (y + 1)) {
      dq.pop_front();
    }
    dq.push_back(i);
    ans = max(ans, b[dq.front()]);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
