#include <bits/stdc++.h>
using namespace std;
int a[2000];
int k, n;
bool cmp(int a, int b) { return a > b; }
int main() {
  scanf("%d", &k);
  while (k--) {
    memset(a, 0, sizeof(a));
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + 1 + n, cmp);
    int ans;
    ans = 1;
    for (int i = 2; i <= n; i++)
      if (a[i] < i) {
        ans = i - 1;
        break;
      } else
        ans = i;
    printf("%d\n", ans);
  }
  return 0;
}
