#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    long long maximum = INT_MIN, diff = 0, t = 0;
    for (long long i = 0; i < n; i++) {
      maximum = max(maximum, a[i]);
      diff = max(diff, maximum - a[i]);
    }
    while ((1LL << t) - 1 < diff) t++;
    cout << t << "\n";
  }
}
