#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7, mod = 1e9 + 7;
const double PI = acos(-1);
long long a[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long mx = -2e9 - 7, ans = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      mx = max(mx, a[i]);
      ans = max(ans, mx - a[i]);
    }
    ans++;
    ans = log2(ans) + (ans != (ans & -ans));
    cout << ans << "\n";
  }
}
