#include <bits/stdc++.h>
using namespace std;
class mairala {
 public:
  void solve();
};
void mairala::solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  int k;
  scanf("%d", &k);
  while (k--) {
    int n, count = 0;
    scanf("%d", &n);
    int arr[n];
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    sort(arr, arr + n);
    for (int i = n - 1; i >= 0; i--) {
      if (arr[i] <= count) break;
      count++;
    }
    printf("%d\n", count);
  }
}
int main(void) {
  mairala m;
  m.solve();
}
