#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const bool dbg_flg = 1;
const int inf = 1e9 + 7;
const int MAXN = 1e5 + 5;
int n;
ll a[MAXN];
int k = 30;
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  ll mx = -inf, x = 0;
  for (int i = 1; i <= n; i++) {
    mx = max(mx, a[i]);
    ll diff = mx - a[i];
    if (diff == 0) continue;
    for (ll j = k; j >= 0; j--) {
      if (diff & (1ll << j)) {
        x = max(x, j + 1);
        break;
      }
    }
  }
  cout << x << '\n';
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  int tt = 1;
  cin >> tt;
  while (tt--) {
    solve();
  }
  return 0;
}
