#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int t, n;
long long int num[N];
void solve() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
  }
  long long int maxi = -1000000000000;
  long long int potAct = 0;
  int ans = -1;
  for (int i = 0; i < n; i++) {
    if (num[i] + potAct < maxi) {
      while (num[i] + potAct < maxi) {
        potAct = (1ll << (++ans)) - 1;
      }
    } else {
      maxi = max(num[i], maxi);
    }
  }
  if (ans == -1)
    cout << "0\n";
  else
    cout << ans << '\n';
}
int main() {
  cin >> t;
  while (t--) solve();
  return 0;
}
