#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 5;
int tc, n, a[sz], b[sz];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> tc;
  while (tc--) {
    cin >> n;
    b[0] = -INT_MAX;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      b[i] = max(a[i], b[i - 1]);
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == b[i]) continue;
      long long dif = abs(a[i] - b[i]);
      int del = __builtin_clz(dif);
      ans = max(ans, 32 - del);
    }
    cout << ans << "\n";
  }
  return 0;
}
