#include <bits/stdc++.h>
using namespace std;
const string __sep = "\n";
const int INF = 1000000001;
const int MOD = 998244353;
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  cin >> T;
  while (T-- > 0) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; ++i) cin >> a[i];
    int curmax = a[0];
    int ans = 0;
    for (int i = 1; i < n; ++i) {
      int cur = a[i];
      if (cur < curmax) {
        int dif = curmax - cur;
        int maxpow = 0;
        while (dif > 0) {
          dif = dif >> 1;
          maxpow++;
        }
        ans = max(ans, maxpow);
      }
      curmax = max(curmax, a[i]);
    }
    cout << ans << "\n";
  }
  return 0;
}
