#include <bits/stdc++.h>
using namespace std;
int a[100004];
int i, j;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int maxx = -1000000000;
    int ans = 0;
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      maxx = max(maxx, a[i]);
      ans = max(ans, maxx - a[i]);
    }
    for (i = 31; i >= 0; i--) {
      if (ans & (1 << i)) {
        cout << i + 1 << '\n';
        break;
      }
    }
    if (i == -1) cout << 0 << '\n';
  }
}
