#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long ans = 0, sgn = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') sgn *= -1;
    c = getchar();
  }
  while (isdigit(c)) {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return ans * sgn;
}
long long A[100005], D[100005];
signed main() {
  long long t = read();
  while (t--) {
    long long n = read(), cur = -2e9;
    memset(A, 0, sizeof(long long) * (n + 5));
    memset(D, 0, sizeof(long long) * (n + 5));
    for (long long i = 0; i < n; ++i) A[i] = read();
    for (long long i = 0; i < n; ++i) {
      if (A[i] > cur)
        cur = A[i];
      else
        D[i] = cur - A[i];
    }
    long long ma = 0;
    for (long long i = 0; i < n; ++i) ma = max(ma, D[i]);
    cout << (ma == 0 ? 0 : (long long)log2(ma) + 1) << endl;
  }
  return 0;
}
