#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
const int MAXM = 1000005;
const int MOD = 1000000007;
const int MAMOD = 998244353;
const int INF = 0x3f3f3f3f;
const int NINF = 0xcfcfcfcf;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double EPS = 1e-8;
long long x;
long long sum[55], stair[35];
int main() {
  ios::sync_with_stdio(0);
  int T;
  stair[1] = 1;
  x = 1;
  for (int i = 1; i <= 31; ++i) {
    stair[i] = stair[i - 1] * 2 + x * x;
    x *= 2;
  }
  for (int i = 1; i <= 31; ++i) sum[i] = sum[i - 1] + stair[i];
  cin >> T;
  while (T--) {
    cin >> x;
    for (int i = 1; i <= 31; ++i) {
      if (sum[i] > x) {
        cout << i - 1 << "\n";
        break;
      }
    }
  }
  return 0;
}
