#include <bits/stdc++.h>
using namespace std;
bool cmp(long long x, long long y) {
  if (x >= y) return 1;
  return 0;
}
const int N = 5e5 + 10;
long long t, n, k, r, m, a[N], ans;
string s;
vector<long long> v;
int main() {
  cin >> t;
  while (t--) {
    k = 0, r = 1;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; i++) {
      m = min(r, a[i]);
      k = max(m, k);
      r++;
    }
    cout << k << endl;
  }
  return 0;
}
