#include <bits/stdc++.h>
using namespace std;
struct re {
  int x, y;
};
const int inf = 1e9 + 10;
const int N = 1e3 + 10;
int ans, n, T, a[N];
bool cmp(int a, int b) { return a > b; }
void solve() {
  ans = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; ++i) ans = max(ans, min(i, a[i]));
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> T;
  while (T--) {
    solve();
    cout << "\n";
  }
  return 0;
}
