#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  int n;
  int a[1000];
  int cnt;
  int minA;
  int answer;
  for (int c = 0; c < k; c++) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    minA = a[n - 1];
    cnt = 1;
    answer = 1;
    for (int i = n - 2; i >= 0; i--) {
      cnt++;
      minA = min(minA, a[i]);
      if (minA < cnt) break;
      answer = cnt;
    }
    cout << answer << endl;
  }
  return 0;
}
