#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
int a[N];
bool cmp(int x, int y) { return x > y; }
int main() {
std:
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    sort(a + 1, a + 1 + n, cmp);
    int ans = 1;
    for (int i = 1; i <= n; ++i) ans = max(ans, min(i, a[i]));
    cout << ans << endl;
  }
  return 0;
}
