#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& res) {
  char c;
  T flag = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = -1;
  res = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') res = res * 10 + c - '0';
  res *= flag;
}
inline void print(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
long long dp[32][2];
int main() {
  ios::sync_with_stdio(false);
  dp[1][1] = 1;
  dp[2][1] = 6;
  dp[3][1] = 28;
  dp[1][0] = 1;
  dp[2][0] = 3;
  dp[3][0] = 7;
  for (int i = 4; i <= 31; ++i) {
    dp[i][0] = 2 * dp[i - 1][0] + 1;
    dp[i][1] = 2 * dp[i - 1][1] + (dp[i - 1][0] + 1) * (dp[i - 1][0] + 1);
  }
  for (int i = 1; i <= 30; ++i) {
    dp[i][1] += dp[i - 1][1];
  }
  int t;
  long long n;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= 31; ++i) {
      if (n < dp[i][1]) {
        cout << i - 1 << endl;
        break;
      }
    }
  }
  return 0;
}
