#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, NEG = -1e7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int q;
  cin >> q;
  int n, y;
  for (int i = 0; i < q; ++i) {
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; ++i) {
      cin >> y;
      v.push_back(y);
    }
    sort(v.begin(), v.end(), greater<int>());
    int mx = 0;
    for (int i = 0; i < v.size(); ++i) {
      if (v[i] <= mx) break;
      mx += 1;
    }
    cout << mx;
    cout << "\n";
  }
}
