#include <bits/stdc++.h>
using namespace std;
int main() {
  signed long long int t, n, m, i, j;
  cin >> t;
  while (t > 0) {
    cin >> n;
    i = 0;
    j = 0;
    m = 1;
    signed long long int last = 0;
    while (i <= n) {
      last = j;
      n -= i;
      i = (2 * i) + (m * m);
      j = j + 1;
      m *= 2;
    }
    cout << last << endl;
    t--;
  }
  return 0;
}
