#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long ans = 1;
    long long count = 1;
    n--;
    long long cur = 0;
    while (n) {
      cur = count + 1 + count;
      long long req = count * ((count + 1) / 2) + (count + 1) * (count + 1) +
                      count * ((count + 1) / 2);
      if (req <= n) {
        ans++;
        n -= req;
      } else {
        break;
      }
      count = cur;
    }
    cout << ans << endl;
  }
  return 0;
}
