#include <bits/stdc++.h>
using namespace std;
int a[1005];
int n;
int main() {
  int _;
  cin >> _;
  while (_--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1);
    int ans = 0, y = 0, x;
    for (int i = n; i >= 1; i--) {
      y++;
      x = a[i];
      ans = max(ans, min(x, y));
    }
    cout << ans << endl;
  }
}
