#include <bits/stdc++.h>
using namespace std;
long long int i, j, k, sum = 0, ans = 1, n, m;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void solve() {
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int j = 1;
  int mini, maxi = INT_MIN;
  for (i = n - 1; i >= 0; i--) {
    mini = min(j, a[i]);
    maxi = max(maxi, mini);
    j++;
  }
  cout << maxi << endl;
}
int main() {
  fastio();
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
