#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const long long mod = 1e9 + 7;
int a[maxn];
int main() {
  int T, n;
  cin >> T;
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    int ans = 1;
    for (int i = 1; i <= n; i++) {
      ans = max(ans, min(a[i], n - i + 1));
    }
    cout << ans << endl;
  }
}
