#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100135;
long long n, diff[MAXN], a[MAXN], pw[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int tc;
  cin >> tc;
  while (tc--) {
    cin >> n;
    long long big = (long long)-1e10, inv = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (big > a[i]) {
        inv = max(inv, big - a[i]);
      }
      big = max(a[i], big);
    }
    long long sec = 0;
    while (inv) {
      sec++;
      inv >>= 1;
    }
    cout << sec << '\n';
  }
  return 0;
}
