#include <bits/stdc++.h>
using namespace std;
function<void(void)> ____ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
};
const int MAXN = 1e5 + 7;
using LL = int_fast64_t;
int n;
LL A[MAXN];
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> A[i];
  LL minn = 1e10;
  LL delta = 0;
  for (int i = n; i >= 1; i--) {
    delta = max(delta, A[i] - minn);
    minn = min(A[i], minn);
  }
  if (!delta)
    cout << 0 << endl;
  else {
    while (delta != (delta & -delta)) delta -= (delta & -delta);
    cout << __builtin_ctz(delta) + 1 << endl;
  }
}
int main() {
  ____();
  int T;
  for (cin >> T; T; T--) solve();
  return 0;
}
