#include <bits/stdc++.h>
using namespace std;
const int MXN = (int)2e5 + 7;
const long long MOD = (long long)1e10 + 7;
int n, t;
long long a[MXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  a[0] = -MOD;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      a[i] += (1LL << 31) - 1;
      for (int j = 30; j >= 0; j--) {
        long long diff = (1LL << j);
        a[i] -= diff;
        if (a[i] < a[i - 1]) {
          ans = max(ans, j + 1);
          a[i] += diff;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
