#include <bits/stdc++.h>
using namespace std;
const long long int N = ((long long int)1e3) + 5;
const long long int M = ((long long int)1e3) + 5;
const long long int llinf = (long long int)1e18;
const int inf = INT_MAX;
long long int T;
long long int n;
long long int arr[N];
long long int cnt[N];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> T;
  while (T--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> arr[i];
    memset(cnt, 0, sizeof cnt);
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= arr[i]; j++) cnt[j]++;
    }
    long long int mx = -inf;
    long long int mxi = 0;
    for (long long int i = 1; i <= cnt[i]; i++) {
      if (min(cnt[i], i) > mx) mx = min(cnt[i], i), mxi = i;
    }
    cout << mxi << "\n";
  }
}
