#include <cstdio>
using namespace std;
int main() {
int T;
scanf("%d", &T);
while (T--) {
long long n;
scanf("%lld", &n);
int k = 1;
while ((k + 1) * (1LL << (k + 1)) - 1 < n) {
k++;
}
printf("%d\n", k);
}
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgaW50IFQ7CiAgICBzY2FuZigiJWQiLCAmVCk7CiAgICB3aGlsZSAoVC0tKSB7CiAgICAgICAgbG9uZyBsb25nIG47CiAgICAgICAgc2NhbmYoIiVsbGQiLCAmbik7CiAgICAgICAgaW50IGsgPSAxOwogICAgICAgIHdoaWxlICgoayArIDEpICogKDFMTCA8PCAoayArIDEpKSAtIDEgPCBuKSB7ICAKICAgICAgICAgICAgaysrOwogICAgICAgIH0KICAgICAgICBwcmludGYoIiVkXG4iLCBrKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==