#include <bits/stdc++.h>
using namespace std;
int cnt(int arr[], int n, int a) {
  int cnttt = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] >= a) cnttt++;
  }
  return cnttt;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    ;
    int side = 1;
    for (int i = 2; i < n + 1; i++) {
      if (cnt(a, n, i) >= i) {
        side = i;
      }
    }
    cout << side << endl;
  }
  return 0;
}
