#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
unsigned long long factorial[1000004];
unsigned long long power(unsigned long long x, int y, int p) {
  unsigned long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
unsigned long long modInverse(unsigned long long n, int p) {
  return power(n, p - 2, p);
}
unsigned long long nc(unsigned long long n, int r, int p) {
  if (r == 0) return 1;
  return (factorial[n] * modInverse(factorial[r], p) % p *
          modInverse(factorial[n - r], p) % p) %
         p;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> a(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long ma = a[0];
    long long ans = 0;
    for (int i = 1; i < n; i++) {
      if (a[i] > ma) {
        ma = a[i];
      } else {
        if ((ma - a[i]) > ans) {
          ans = (ma - a[i]);
        }
      }
    }
    int p = 0;
    while (ans > 0) {
      p++;
      ans /= 2;
    }
    cout << p << "\n";
  }
  return 0;
}
