#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, t;
long long a[N];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
    }
    for (int j = 0; j < 60; j++) {
      long long k = (1ll << (long long)j);
      k--;
      long long last = a[n - 1] + k;
      bool yes = true;
      for (int i = n - 2; i >= 0; i--) {
        if (a[i] > last) {
          yes = false;
          break;
        }
        last = min(a[i] + k, last);
      }
      if (yes) {
        printf("%d\n", j);
        break;
      }
    }
  }
  return 0;
}
