#include <bits/stdc++.h>
using namespace std;
vector<long long int> prime;
vector<vector<long long int> > gr[200005];
void sieve(long long int n) {
  bool p[n + 1];
  memset(p, true, sizeof(p));
  for (long long int i = 2; i * i <= n; i++) {
    if (p[i]) {
      for (int j = i * i; j <= n; j += i) {
        p[j] = false;
      }
    }
  }
  for (long long int i = 2; i <= n; i++) {
    if (p[i]) {
      prime.push_back(i);
    }
  }
}
long long int near(long long int v) {
  long long int x = 1;
  while (v > 1) {
    v /= 2;
    x *= 2;
  }
  return x;
}
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int maxx = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] < a[i - 1]) {
      maxx = max(maxx, a[i - 1] - a[i]);
      a[i] = a[i - 1];
    }
  }
  cout << (long long int)ceil(log2(maxx + 1)) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
