#include <bits/stdc++.h>
using namespace std;
int main() {
  int cs = 1;
  int cn = 1;
  cin >> cs;
  while (cs--) {
    long long int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) cin >> arr[i];
    int dif = 0;
    int maxt = -INT_MAX;
    for (int i = 0; i < n; i++) {
      if (maxt > arr[i]) {
        dif = max(dif, (maxt - arr[i]));
      }
      maxt = max(maxt, arr[i]);
    }
    int t = 0;
    if (dif > 0) t = log2(dif) + 1;
    cout << t << endl;
  }
}
