#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < int(n); i++) cin >> a[i];
  long long diff = 0;
  int m = a[0];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] >= m) {
      m = a[i];
    } else {
      diff = (m - a[i]);
      int d = floor(log2(diff)) + 1;
      ans = max(d, ans);
    }
  }
  cout << ans << endl;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
