#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int k;
  cin >> k;
  while (k-- > 0) {
    int n, i;
    cin >> n;
    vector<long long int> a(n);
    for (long long int &x : a) cin >> x;
    long long int prev_big = a[0], max_diff = 0, req_time = 0;
    for (i = 1; i < n; ++i) {
      if (prev_big < a[i])
        prev_big = a[i];
      else if (prev_big > a[i]) {
        max_diff =
            ((prev_big - a[i]) > max_diff) ? (prev_big - a[i]) : max_diff;
        a[i] = prev_big;
      }
    }
    if (max_diff >= 1) req_time = floor(log2(max_diff)) + 1;
    cout << req_time << "\n";
  }
  return 0;
}
