#include <bits/stdc++.h>
using namespace std;
int solve() {
  long long n;
  cin >> n;
  vector<long long int> a(n);
  long long ans = 0;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 1; i < n; i++) {
    long long d = a[i] - a[i - 1];
    if (d >= 0)
      continue;
    else {
      d *= -1;
      ans = max(ans, (long long)floor(log2(d)) + 1);
      a[i] = a[i - 1];
    }
  }
  cout << ans << "\n";
  return 0;
}
int main() {
  auto start = chrono::high_resolution_clock::now();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test_cases = 1;
  cin >> test_cases;
  while (test_cases--) solve();
  auto stop = chrono::high_resolution_clock::now();
  auto duration = chrono::duration_cast<chrono::milliseconds>(stop - start);
}
