#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int ar[n], i, b;
    b = n;
    for (i = 0; i < n; i++) cin >> ar[i];
    sort(ar, ar + n);
    for (i = 0; i < n; i++) {
      if (ar[i] < b)
        b--;
      else
        break;
    }
    cout << b << "\n";
  }
}
