#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int T, n, x;
int main() {
  cin >> T;
  for (int t = 0; t < T; t++) {
    int k = 1, ans;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> x;
      v.push_back(x);
    }
    sort(v.rbegin(), v.rend());
    for (int j = 0, z = v.size(); j < z; j++, k++) {
      if (v[j] < k) break;
      ans = min(k, v[j]);
    }
    cout << ans << endl;
    v.clear();
  }
}
