#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 42;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  if (is_sorted(a.begin(), a.end())) {
    cout << "0\n";
    return;
  }
  long long comparer = a[0];
  long long time = 0;
  for (long long i = 1; i < n; i++) {
    if (a[i] > comparer)
      comparer = a[i];
    else {
      long long extra = comparer - a[i];
      long long cnt = log2(extra) + 1;
      time = max(time, cnt);
    }
  }
  cout << time << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
