#include <bits/stdc++.h>
using namespace std;
int k;
int n;
int planks[1005];
int g = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> k;
  for (int t = 0; t < k; t++) {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> planks[i];
    sort(planks, planks + n, [](int a, int b) { return a > b; });
    g = 0;
    for (int i = 0; i < n; i++)
      if (planks[i] >= i + 1) g = max(g, i + 1);
    cout << g << "\n";
  }
}
