#include <bits/stdc++.h>
using namespace std;
int II() {
  int q;
  scanf("%d", &q);
  return q;
}
void solve() {
  long long N;
  cin >> N;
  long long ar[N + 10];
  for (long long i = 1; i <= N; i++) cin >> ar[i];
  long long sum = ar[1];
  long long mx = 0;
  for (long long i = 1; i <= N; i++) {
    sum = max(sum, ar[i]);
    mx = max(mx, sum - ar[i]);
  }
  long long ans = 0;
  while (mx) ans++, mx /= 2;
  cout << ans << endl;
}
int32_t main() {
  long long tt;
  cin >> tt;
  long long cas = 1;
  while (tt--) {
    solve();
  }
}
