#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
const long long INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const long long MOD = 1e9 + 7;
const long double EPS = 1e-9;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    vector<int> a(n + 1);
    a[0] = -INF;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] < a[i - 1]) {
        ans = max(ans, 32 - __builtin_clz(a[i - 1] - a[i]));
      }
      a[i] = max(a[i], a[i - 1]);
    }
    cout << ans << nl;
  }
  return 0;
}
