#include <bits/stdc++.h>
using namespace std;
const int N = 233333;
long long T, n, tot, ans, a[N], base[N], now;
long long check(long long x) {
  for (int i = tot; i >= 0; i--)
    if (x >= base[i]) return i + 1;
}
int main() {
  scanf("%lld", &T);
  tot = -1;
  for (long long i = 1; i <= 2000000000; i *= 2) base[++tot] = i;
  while (T--) {
    scanf("%lld", &n);
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
    ans = 0, now = a[1];
    for (int i = 1; i <= n; i++) {
      if (now > a[i]) {
        ans = max(ans, check(now - a[i]));
        a[i] = now;
      }
      now = max(now, a[i]);
    }
    printf("%lld\n", ans);
  }
  return 0;
}
