#include <bits/stdc++.h>
using namespace std;
void print_int(vector<int>);
void print_ll(vector<long long>);
long long power(long long, long long);
void solve() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < int(n); i++) {
    cin >> arr[i];
  }
  int maxx = -(1e9 + 7);
  vector<long long> v(n);
  for (int i = 0; i < int(n); i++) {
    maxx = max(maxx, arr[i]);
    v[i] = maxx;
  }
  int ans = 0;
  for (int i = 0; i < int(n); i++) {
    int p = 0;
    int val = 1;
    while (arr[i] < v[i]) {
      arr[i] += val;
      val *= 2;
      p++;
    }
    ans = max(ans, p);
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  cin >> T;
  for (int t = 1; t <= T; t++) {
    solve();
  }
  return 0;
}
void print_int(vector<int> v) {
  for (int i : v) cout << i << " ";
  cout << endl;
}
void print_ll(vector<long long> v) {
  for (long long i : v) cout << i << " ";
  cout << endl;
}
long long power(long long n, long long p) {
  long long res = 1;
  while (p != 0) {
    if (p & 1) res = res * n;
    n = n * n;
    p = p >> 1;
  }
  return res;
}
