#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
int a[111111];
int main() {
  int tc;
  cin >> tc;
  for (int TC = (0); TC < (tc); TC++) {
    int n;
    cin >> n;
    for (int i = (0); i < (n); i++) scanf("%d", a + i);
    int res = 0;
    int m = a[0];
    for (int i = (0); i < (n); i++) {
      m = max(m, a[i]);
      res = max(res, m - a[i]);
    }
    long long w = 0;
    int t = 0;
    while (w < res) {
      t++;
      w += (1ll << (t - 1));
    }
    cout << t << endl;
  }
  return 0;
}
