#include <bits/stdc++.h>
using namespace std;
long long a[1000005], p[1000005];
int main() {
  p[0] = 1;
  for (int i = 1; i <= 31; i++) p[i] = p[i - 1] * 2;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long maxs = -1000000008, ans = 0;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) {
      maxs = max(maxs, a[i]);
      if (a[i] < maxs) {
        long long num = maxs - a[i], sum = 0;
        while (num) num /= 2, sum++;
        ans = max(ans, sum);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
