#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int n) {
  long long int result = 1;
  while (n > 0) {
    if (n & 1) result = result * x;
    x = x * x;
    n /= 2;
  }
  return result;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n + 5], i;
    for (i = 1; i <= n; i++) cin >> arr[i];
    long long int diff = 0, maxi = arr[1];
    for (i = 2; i <= n; i++) {
      if (arr[i] < maxi) diff = max(diff, maxi - arr[i]);
      maxi = max(maxi, arr[i]);
    }
    long long int ans = 0;
    while (diff > 0) {
      diff -= 1LL << ans;
      ans++;
    }
    cout << ans << "\n";
  }
  return 0;
}
