#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int t, n, a[MAXN], ans;
int chk(int x) {
  for (int i = 30; i >= 0; i--) {
    if (x & (1 << i)) {
      return i + 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d", &t);
  for (int ii = 1; ii <= t; ii++) {
    scanf("%d", &n);
    int mx = -1e9 - 1;
    ans = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (a[i] > mx) {
        mx = a[i];
      } else {
        ans = max(ans, chk(mx - a[i]));
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
