#include <bits/stdc++.h>
using namespace std;
long long N, M, K, A, B, X, Y, Z, C, D, a, b, c, d, i, j, k;
long long logfind(long long number) {
  long long ans = 0;
  while (number >>= 1) ++ans;
  return ans;
}
void solve() {
  cin >> N;
  long long A[N], ans = -100000000000007LL;
  for (int i = 0; i < N; i++) cin >> A[i];
  long long mx = A[0];
  for (int i = 1; i < N; i++) {
    if (A[i] < mx) ans = max(ans, mx - A[i]);
    mx = max(mx, A[i]);
  }
  if (ans == 0 || ans == -100000000000007LL) {
    cout << "0" << '\n';
  } else {
    long long p = logfind(ans);
    cout << 1 + p << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
