#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long cl(double a) {
  if (a > (long long)a) {
    return (long long)a + 1;
  } else {
    return (long long)a;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long x;
    cin >> x;
    if (x == 0) {
      cout << 0 << "\n";
      continue;
    }
    long long ans = 1;
    long long p = 2;
    long long curr = p - 1;
    long long cells = 1;
    while (cells <= x) {
      ans++;
      x -= cells;
      p *= 2;
      curr = p - 1;
      cells = (curr * (curr + 1)) / 2;
    }
    ans--;
    cout << ans << "\n";
  }
}
