#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int MAX = 1e3 + 5;
const int MOD = 1e9 + 7;
const int64_t INF = INT_MAX;
const int64_t _INF = INT_MIN;
int k, n;
int h[MAX];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> k;
  while (k--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> h[i];
    int ans = 0;
    sort(h + 1, h + n + 1);
    for (int i = 1; i <= n; i++) ans = max(ans, min(h[n - i + 1], i));
    cout << ans << "\n";
  }
}
