#include <bits/stdc++.h>
using namespace std;
vector<long long int> pow2(40, 0);
vector<long long int> prefix(45, 0);
void inp() {
  long long int N, M, X, Y, Z, K, Q, co = 0, prevMax = -1000000008,
                                     prevMin = 100000000000008;
  string A, B, C;
  char P, R;
  bool flag = true, flag1 = true, flag3 = true;
  vector<long long int> val, v1, v2, v1A, v2A;
  cin >> N;
  int j = 0;
  while (prefix[j] <= N) {
    j++;
  }
  j--;
  cout << j << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  cin >> T;
  pow2[0] = 0;
  long long int prev = 1;
  for (long long int i = 1; i < 40; i++) {
    long long int temp = 2 * prev - 1;
    pow2[i] = (temp * (temp + 1)) / 2;
    prev = 2 * prev;
  }
  for (long long int i = 1; i < 40; i++) {
    prefix[i] = prefix[i - 1] + pow2[i];
  }
  for (long long int i = 0; i < T; i++) {
    inp();
  }
  return 0;
}
