#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}
void solve() {
  int N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < (N); ++i) cin >> A[i];
  long long ma = A[0];
  long long diff = 0;
  for (int i = 1; i < N; i++) {
    if (ma <= A[i]) {
      ma = A[i];
      continue;
    }
    chmax(diff, ma - A[i]);
  }
  int ans = -1;
  for (long long i = 0; i < 60; i++) {
    if ((1ll << i) & diff) ans = i;
  }
  cout << ans + 1 << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  for (int i = 0; i < (T); ++i) solve();
  return 0;
}
