#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; ++i) {
      cin >> a[i];
    }
    long long ans = 0;
    for (long long i = 1; i < n; ++i) {
      long long r = max(0ll, a[i - 1] - a[i]);
      if (r) {
        ans = max(ans, (long long)log2(r) + 1);
      }
      a[i] = max(a[i], a[i - 1]);
    }
    cout << ans << '\n';
  }
  return 0;
}
