#include <bits/stdc++.h>
using namespace std;
long long n, t, a[1001], b[1001];
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    memset(b, 0, sizeof(b));
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      for (int j = 1; j <= x; j++) {
        b[j]++;
      }
    }
    int k;
    for (int i = n; i >= 1; i--) {
      if (b[i] >= i) {
        k = i;
        break;
      }
    }
    cout << k << endl;
  }
}
