#include <bits/stdc++.h>
using namespace std;
template <typename T>
T countDigit(T n) {
  return ((n == 0) ? 1 : floor(log10(n) + 1));
}
template <typename T>
T GCD(T a, T b) {
  return ((b % a == 0) ? a : GCD(b % a, a));
}
long long mod_by = 1e18 + 7;
long long binpow(long long a, long long b) {
  a %= mod_by;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod_by;
    a = a * a % mod_by;
    b >>= 1;
  }
  return res;
}
bool sortcol(const vector<long long>& v1, const vector<long long>& v2) {
  return v1[0] < v2[0];
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
pair<long long, long long> comman_range(pair<long long, long long> p1,
                                        pair<long long, long long> p2) {
  long long a = max(p1.first, p2.first), b = min(p1.second, p2.second);
  return (a > b) ? make_pair(-1ll, -1ll) : make_pair(a, b);
}
void solve() {
  long long t, case_;
  cin >> t;
  case_ = t;
  std::vector<long long> v;
  for (long long i = 0; i < 32; ++i) {
    v.push_back(pow(2, i) - 1);
  }
  std::vector<long long> pre;
  for (int i = 0; i < 32; ++i) {
    pre.push_back((v[i] * (v[i] + 1)) / 2);
  }
  while (t--) {
    long long n;
    cin >> n;
    long long ans = 0;
    for (int i = 0; i < 32; ++i) {
      if (n >= pre[i]) {
        n -= pre[i];
        ans++;
      }
    }
    cout << ans - 1;
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
