#include <bits/stdc++.h>
using namespace std;
int x[1001];
int main() {
  int k, n;
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &n);
    for (int j = 0; j < n; j++) {
      scanf("%d", &x[j]);
    }
    sort(x, x + n);
    int height = 1;
    for (int j = n - 1; j >= 0; j--) {
      if (x[j] >= height)
        height++;
      else
        break;
    }
    printf("%d\n", height - 1);
  }
}
