#include <bits/stdc++.h>
using namespace std;
const long long mn = -1 * (long long)1e17;
template <typename T>
void debug(T v) {
  cout << v << '\n';
}
template <typename T>
void debug(vector<T> v) {
  for (long long i = 0; i < (long long)v.size(); i++) {
    cout << i << " " << v[i] << '\n';
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long mx = mn;
    long long ans = 0;
    for (long long i = 0; i < n; i++) {
      if (a[i] >= mx) {
        mx = a[i];
        continue;
      }
      long long diff = mx - a[i];
      long long add = -1;
      while (diff > 0) {
        ++add;
        diff -= (1ll << add);
      }
      ans = max(ans, add + 1);
    }
    cout << ans << '\n';
  }
  return 0;
}
