#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
template <typename T>
using heap = priority_queue<T, vector<T>, function<bool(const T, const T)>>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int _ = 0; _ < (t); _++) {
    int n;
    cin >> n;
    vi a(n);
    for (int i = 0; i < (n); i++) cin >> a[i];
    int ma = 0;
    for (int i = (1); i < (n); i++) {
      ma = max(ma, a[i - 1] - a[i]);
      a[i] = max(a[i], a[i - 1]);
    }
    int ans = 0;
    while (ma) {
      ma >>= 1;
      ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
