#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    int ans = 0, mx = -1e9, mxdiff = 0;
    cin >> n;
    int arr[n];
    cin >> arr[0];
    mx = arr[0];
    for (int i = 1; i < n; ++i) {
      cin >> arr[i];
      mx = max(mx, arr[i]);
      if (arr[i] < mx) {
        mxdiff = max(mxdiff, mx - arr[i]);
      }
    }
    while (mxdiff > 0) ans++, mxdiff -= pow(2, ans - 1);
    cout << ans << '\n';
  }
}
