#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
const long long mod = 1e9 + 7;
const long long N = (long long)5e5 + 4;
template <typename... T>
void read(T &...args) {
  ((cin >> args), ...);
}
template <typename... T>
void write(T &&...args) {
  ((cout << args), ...);
}
void vjudge() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long add(long long a, long long b) { return (a % mod + b % mod) % mod; }
void solve() {
  long long n;
  read(n);
  vector<long long> a(n);
  long long mx = INT_MIN;
  long long val = 0;
  for (long long i = 0; i < n; i++) {
    read(a[i]);
    mx = max(mx, a[i]);
    val = max(val, mx - a[i]);
  }
  long long res = 0;
  while ((1LL << res) - 1 < val) {
    ++res;
  }
  cout << res << '\n';
}
int32_t main() {
  vjudge();
  long long t = 1;
  read(t);
  while (t--) solve();
}
