#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int N;
    cin >> N;
    int A[N], i, j, tot = 0, max = 0;
    for (i = 0; i < N; ++i) {
      cin >> A[i];
    }
    sort(A, A + N, greater<int>());
    int l, b;
    for (i = 0; i < N; ++i) {
      l = A[i];
      b = i + 1;
      if ((b <= l) && max < b) {
        max = b;
      }
    }
    cout << max << endl;
  }
}
