------
## 最终结论
```python
def max_nice_staircases(t, test_cases):
    results = []
    for x in test_cases:
        count = 0
        n = 1
        while True:
            cells_needed = (n * (n + 1)) // 2
            if cells_needed > x:
                break
            x -= cells_needed
            count += 1
            n = n * 2 + 1
        results.append(count)
    return results

# Read input values
t = int(input().strip())
test_cases = [int(input().strip()) for _ in range(t)]

# Calculate results for each test case
results = max_nice_staircases(t, test_cases)

# Print the result for each test case
for result in results:
    print(result)
```