#include <bits/stdc++.h>
using namespace std;
double pai = 3.14159265359;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
inline long long lread() {
  long long tmp = 0, fh = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') fh = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar();
  return tmp * fh;
}
long long a[1000006];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    n = read();
    a[0] = lread();
    int ans = 0;
    for (int i = 1; i < n; i++) {
      a[i] = lread();
      if (a[i] >= a[i - 1])
        continue;
      else {
        long long c = a[i - 1] - a[i];
        int k = 0;
        while (c) {
          c /= 2;
          k++;
        }
        ans = max(k, ans);
        a[i] = a[i - 1];
      }
    }
    cout << ans << '\n';
  }
}
