#include <bits/stdc++.h>
using namespace std;
string sconvert(int n) {
  stringstream ss;
  ss << n;
  string str = ss.str();
  return str;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int test;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    vector<long long int> arr(n);
    for (int i = 0; i < n; i++) cin >> arr[i];
    ;
    vector<long long int> temp;
    temp = arr;
    long long int m = 0;
    for (int i = 1; i < n; i++) {
      if (arr[i - 1] > arr[i]) arr[i] = arr[i - 1];
    }
    long long int mdiff = INT_MIN;
    for (int i = 0; i < n; i++) {
      mdiff = max(mdiff, arr[i] - temp[i]);
    }
    if (!mdiff)
      cout << 0 << '\n';
    else
      cout << (long long int)log2(mdiff) + 1 << '\n';
  }
}
