#include <bits/stdc++.h>
using namespace std;
const int64_t INF = 1e18, MOD = 1e9 + 7;
int64_t n;
vector<int64_t> a;
bool can(int64_t k) {
  int64_t maxi = -INF;
  for (int64_t i = 0; i < n; i++) {
    int64_t dif = maxi - a[i];
    if (dif >= (int64_t(1) << (k))) return 0;
    maxi = max((maxi), (a[i]));
  }
  return 1;
}
int64_t solve() {
  cin >> n;
  a = vector<int64_t>(n);
  for (int64_t i = 0; i < n; i++) cin >> a[i];
  int64_t l = 0, r = 60, mid, ans = -1;
  while (l < r) {
    mid = (l + r) / 2;
    if (can(mid))
      r = mid, ans = mid;
    else
      l = mid + 1;
  }
  cout << ans << endl;
  return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  int64_t t = 1;
  cin >> t;
  for (int64_t i = 0; i < t; i++) solve();
  return 0;
}
