#include <bits/stdc++.h>
using namespace std;
signed main() {
  int k, n, ans, a[1001], i, t;
  cin >> k;
  while (k--) {
    ans = 0;
    cin >> n;
    for (i = 0; i < n; ++i) cin >> a[i];
    sort(a, a + n);
    for (i = 0; i < n; ++i) {
      t = min(n - i, a[i]);
      ans = max(ans, t);
    }
    cout << ans << endl;
  }
  return 0;
}
