#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v;
    long long int m = 0;
    for (int i = 0; i < n; i++) {
      long long int x;
      cin >> x;
      v.push_back(x);
    }
    for (int i = 1; i < n; i++) {
      if (v[i] < v[i - 1]) {
        long long int c = 0;
        long long int d = v[i - 1] - v[i];
        c = log2(d) + 1;
        m = max(m, c);
        v[i] = v[i - 1];
      }
    }
    cout << m << endl;
  }
}
