#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long factorial(long long a) {
  long long r = 1;
  for (int i = 1; i <= a; i++) {
    r *= i;
    r = r % MOD;
  }
  return r % MOD;
}
void printArray(int arr[], int n) {
  for (int i = 0; i < n; i++) printf("%d ", arr[i]);
  printf("\n");
}
int main() {
  int tt = 1, qq = 1;
  vector<long long> arr(40);
  arr[0] = 1;
  for (int i = 1; i < 40; i++) {
    arr[i] = arr[i - 1] * 2 + 1;
  }
  for (int i = 0; i < 40; i++) {
    arr[i] = arr[i] * (arr[i] + 1) / 2;
  }
  for (int i = 1; i < 40; i++) {
    arr[i] += arr[i - 1];
  }
  cin >> tt;
  while (tt--) {
    long long x;
    cin >> x;
    for (int i = 0; i < 40; i++) {
      if (arr[i] > x) {
        cout << i << endl;
        break;
      }
    }
  }
  return 0;
}
