#include <bits/stdc++.h>
using namespace std;
void swap(int* a, int* b) {
  int tmp = *a;
  *a = *b;
  *b = tmp;
}
void input(vector<int>& arr, int n) {
  for (int i = 0; i <= n - 1; ++i) {
    cin >> arr[i];
  }
}
void input(vector<long long int>& arr, int n) {
  for (int i = 0; i <= n - 1; ++i) {
    cin >> arr[i];
  }
}
void input(vector<unsigned long long int>& arr, int n) {
  for (int i = 0; i <= n - 1; ++i) {
    cin >> arr[i];
  }
}
long long int max(long long int a, long long int b) { return a > b ? a : b; }
unsigned long long int max(unsigned long long int a, unsigned long long int b) {
  return a > b ? a : b;
}
int max(int a, int b) { return a > b ? a : b; }
void print(vector<int>& ans, int n) {
  for (int i = 0; i <= n - 1; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
void print(vector<long long int>& ans, int n) {
  for (int i = 0; i <= n - 1; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  input(arr, n);
  vector<long long int> dp(n, 0);
  dp[0] = arr[0];
  long long int max_diff = 0;
  for (int i = 1; i <= n - 1; ++i) {
    dp[i] = max(arr[i], dp[i - 1]);
    max_diff = max(max_diff, abs(dp[i] - arr[i]));
  }
  int p = 1;
  if (max_diff == 0) {
    cout << 0 << endl;
    return;
  }
  while (true) {
    long long int _2p = (long long int)pow(2, p) - 1;
    if (max_diff <= _2p) {
      cout << p << endl;
      return;
    }
    ++p;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
