#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const char E = '\n';
const int N = 20015;
const int NN = 1000000;
const long long md = 1e9 + 7;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  int tttt;
  cin >> tttt;
  while (tttt--) {
    int n;
    cin >> n;
    vector<long long> a(n + 5);
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    long long l = 1, mn = 1001007000;
    long long mx = 0;
    for (int i = 2; i <= n; i++) {
      if (a[i] < a[l] && i != n) {
        mn = min(mn, a[i]);
        continue;
      }
      mn = min(mn, a[i]);
      mx = max(mx, a[l] - mn);
      mn = 1001007000;
      l = i;
    }
    long long ans = 0;
    long long t = 0;
    while (t < mx) {
      ans++;
      t += (1 << (ans - 1));
    }
    cout << ans << E;
  }
  return 0;
}
