#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T a) {
  for (auto x : a) cout << x << ' ';
  cout << endl;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort((a).rbegin(), (a).rend());
  long long ans = 1;
  for (long long i = 0; i < n; i++) {
    if (a[i] >= i + 1) ans = i + 1;
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long k;
  cin >> k;
  for (long long i = 0; i < k; i++) solve();
  return 0;
}
