#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, a;
  cin >> t;
  while (t--) {
    int max = -0x3f3f3f3f, maxd = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a;
      if (a > max)
        max = a;
      else if (i > 0 && max - a > maxd)
        maxd = max - a;
    }
    int ans = 0;
    while (maxd) {
      ans++;
      maxd >>= 1;
    }
    cout << ans << endl;
  }
  return 0;
}
