#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 12;
int a[maxn];
int main() {
  ios ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int k, n;
  cin >> k;
  while (k--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    int mx = 1;
    for (int i = n - 1; i >= 0; i--) {
      mx = max(mx, min(a[i], n - i));
    }
    cout << mx << "\n";
  }
}
