#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int t, n, a[maxn];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + 1 + n);
    int ans = 0;
    for (int i = n; i; i--) {
      ans = max(ans, min(n - i + 1, a[i]));
    }
    printf("%d\n", ans);
  }
  return 0;
}
