#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ul = unsigned long long;
using pii = pair<int, int>;
using vvi = vector<vector<int>>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int a[n];
    int x = 0;
    cin >> a[0];
    for (int i = 1; i < n; i++) {
      cin >> a[i];
      if (a[i] < a[i - 1]) {
        ll diff = a[i - 1] - a[i];
        int t = 0;
        while (diff) {
          t++;
          diff >>= 1;
        }
        if (t > x) x = t;
        a[i] = a[i - 1];
      }
    }
    cout << x << '\n';
  }
}
