#include <bits/stdc++.h>
using namespace std;
double startTime;
double gct() { return ((double)clock() - startTime) / CLOCKS_PER_SEC; }
void suraj() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int &i : v) cin >> i;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (v[i] < v[i - 1]) {
      int nsec = 0, diff = v[i - 1] - v[i];
      while (diff > 0) {
        nsec++;
        diff /= 2;
      }
      ans = max(ans, nsec);
      v[i] = v[i - 1];
    }
  }
  cout << ans << "\n";
}
int main() {
  startTime = (double)clock();
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) suraj();
  return 0;
}
