#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
long long a[1000010];
int main() {
  fast();
  long long t, n;
  long long st[50];
  st[1] = 1;
  for (int i = 2; i <= 40; ++i) st[i] = st[i - 1] * 2 + 1;
  cin >> t;
  long long mn, ans, v;
  while (t--) {
    cin >> n;
    ans = 0;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
      if (i == 1) mn = a[1];
      if (a[i] >= mn)
        mn = a[i];
      else {
        v = mn - a[i];
        for (long long j = 1; j <= 40; ++j) {
          if (st[j] >= v) {
            ans = max(j, ans);
            break;
          }
        }
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
