#include <bits/stdc++.h>
using namespace std;
long long int t;
long long int powmod(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> a(n);
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long int ans = 0;
    for (long long int i = 1; i < n; i++) {
      if (a[i] < a[i - 1]) {
        long long int diff = a[i - 1] - a[i];
        long long int temp = (long long int)log2(diff) + 1;
        ans = max(ans, temp);
        a[i] = a[i - 1];
      }
    }
    cout << ans;
    cout << "\n";
  }
}
