#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000;
const long long int MAXVAL = 1000000000000000001;
int a[MAXN];
int main(void) {
  int k, n;
  cin >> k;
  while (k--) {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n, greater<int>());
    int res = -1;
    for (int i = 0; i < n; i++)
      if (i + 1 > a[i]) {
        res = i;
        break;
      }
    cout << ((res == -1) ? n : res) << endl;
  }
}
