#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; ++i) {
      cin >> arr[i];
    }
    int anss = 0, prev = arr[0];
    for (int i = 1; i < n; ++i) {
      if (prev > arr[i]) {
        int j = 0, diff = prev - arr[i];
        while (diff > 0) {
          diff = diff >> 1;
          j++;
        }
        anss = max(anss, j);
      } else {
        prev = arr[i];
      }
    }
    cout << anss << endl;
  }
  return 0;
}
