#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9 + 1;
const int N = 1e5 + 10;
int n;
long long po[34];
void solve() {
  cin >> n;
  vector<long long> a(n);
  vector<long long> mi(n);
  int pos = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i > 0 && a[i - 1] > a[i] && pos == -1) pos = i;
  }
  if (pos == -1) {
    cout << 0 << "\n";
    return;
  }
  mi[n - 1] = a[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    mi[i] = min(a[i], mi[i + 1]);
  }
  long long x = 0;
  for (int i = 0; i < n - 1; i++) {
    x = max(x, a[i] - mi[i + 1]);
  }
  int cnt = 0;
  while (x) {
    cnt++;
    x /= 2;
  }
  cout << cnt << "\n";
}
int main() {
  int t = 1;
  po[0] = 1;
  for (int i = 1; i < 33; i++) {
    po[i] = po[i - 1] * 2;
  }
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
