#include <bits/stdc++.h>
using namespace std;
int t, n;
long long a[100005];
int get_bit(long long x) {
  int ans = 0;
  while (x) {
    ans++;
    x >>= 1;
  }
  return ans;
}
int main() {
  int i, j;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
    int ans = 0, last = a[1];
    for (i = 2; i <= n; i++) {
      if (a[i] >= last) {
        last = a[i];
        continue;
      }
      ans = max(ans, get_bit(last - a[i]));
    }
    printf("%d\n", ans);
  }
  return 0;
}
