#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    std::vector<int> a(n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    int minadd = 0;
    int cur = a[0];
    for (int i = 1; i < n; i++) {
      if (cur > a[i]) {
        minadd = std::max(minadd, cur - a[i]);
      }
      cur = std::max(cur, a[i]);
    }
    int nBits = 0;
    while (minadd) {
      nBits++;
      minadd >>= 1;
    }
    printf("%d\n", nBits);
  }
  return 0;
}
