#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &x : a) {
    cin >> x;
  }
  int mx = 0;
  for (int i = 1; i < n; ++i) {
    if (a[i] < a[i - 1]) {
      int v = a[i - 1] - a[i];
      mx = max(mx, v);
      a[i] += v;
    }
  }
  if (mx == 0) {
    cout << "0\n";
    return;
  }
  cout << (int)log2(mx) + 1 << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  cin >> T;
  for (ll i(1), _i(T); i <= _i; ++i) {
    solve();
  }
}
