#include <bits/stdc++.h>
using namespace std;
map<unsigned long long, unsigned long long> m;
unsigned long long x;
unsigned long long lis[100] = {0};
void init() {
  unsigned long long tx = 1;
  unsigned long long temp = 1;
  unsigned long long tt;
  for (int i = 1; i <= 32; i++) {
    tx *= 2;
    temp = tx - 1;
    if (temp % 2 == 0) {
      tt = temp / 2;
      tt *= (temp + 1);
    } else {
      tt = (temp + 1) / 2;
      tt *= temp;
    }
    lis[i] = temp;
    m[temp] = tt;
  }
}
int main() {
  int t;
  init();
  cin >> t;
  while (t--) {
    scanf("%lld", &x);
    int ans = 0;
    for (int i = 1; i <= 32; i++) {
      if (x < m[lis[i]]) break;
      x -= m[lis[i]];
      ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
