You have an array a of length n. For every positive integer x you are going to perform the following operation during the x-th second:

  * Select some distinct indices i_{1}, i_{2}, …, i_{k} which are between 1 and n inclusive, and add 2^{x-1} to each corresponding position of a. Formally, a_{i_{j}} := a_{i_{j}} + 2^{x-1} for j = 1, 2, …, k. Note that you are allowed to not select any indices at all.



You have to make a nondecreasing as fast as possible. Find the smallest number T such that you can make the array nondecreasing after at most T seconds.

Array a is nondecreasing if and only if a_{1} ≤ a_{2} ≤ … ≤ a_{n}.

You have to answer t independent test cases.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^{4}) — the number of test cases.

The first line of each test case contains single integer n (1 ≤ n ≤ 10^{5}) — the length of array a. It is guaranteed that the sum of values of n over all test cases in the input does not exceed 10^{5}.

The second line of each test case contains n integers a_{1}, a_{2}, …, a_{n} (-10^{9} ≤ a_{i} ≤ 10^{9}).

Output

For each test case, print the minimum number of seconds in which you can make a nondecreasing.

Example

Input


3
4
1 7 6 5
5
1 2 3 4 5
2
0 -4


Output


2
0
3

Note

In the first test case, if you select indices 3, 4 at the 1-st second and 4 at the 2-nd second, then a will become [1, 7, 7, 8]. There are some other possible ways to make a nondecreasing in 2 seconds, but you can't do it faster.

In the second test case, a is already nondecreasing, so answer is 0.

In the third test case, if you do nothing at first 2 seconds and select index 2 at the 3-rd second, a will become [0, 0].
#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
long long int Mod(long long int n) { return ((n % mod) + mod) % mod; }
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long int f[200005];
long long int invfact[200005];
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % mod;
    }
    x = (x * x) % mod;
    y >>= 1;
  }
  return res;
}
void precal() {
  f[0] = 1;
  invfact[0] = 1;
  for (int i = 1; i < 200005; i++) {
    f[i] = (f[i - 1] * i) % mod;
    invfact[i] = power(f[i], mod - 2);
  }
}
long long int fact(long long int n, long long int k) {
  if (n < k) {
    return 0;
  }
  return ((f[n] * invfact[k]) % mod * invfact[n - k]) % mod;
}
bool prime[10000011];
void primenumbers(long long int n) {
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
long long int modI(long long int a, long long int m) {
  long long int m0 = m, y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long int q = a / m;
    long long int t = m;
    m = a % m;
    a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
int spf[100001];
void sieve() {
  spf[1] = 1;
  for (int i = 2; i < 100001; i++) spf[i] = i;
  for (int i = 4; i < 100001; i += 2) spf[i] = 2;
  for (int i = 3; i * i < 100001; i++) {
    if (spf[i] == i) {
      for (int j = i * i; j < 100001; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
vector<int> getFactorization(int x) {
  vector<int> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
const long long int mxn = 400010;
long long int st[mxn];
long long int a[mxn];
void build(long long int v, long long int l, long long int r) {
  if (l == r) {
    st[v] = a[l];
  } else {
    build(2 * v, l, (l + r) / 2);
    build(2 * v + 1, (l + r) / 2 + 1, r);
    st[v] = st[2 * v] * st[2 * v + 1];
  }
}
void update(long long int v, long long int l, long long int r,
            long long int pos, long long int val) {
  if (pos < l || pos > r) {
    return;
  }
  if (pos == l && pos == r) {
    st[v] = val;
  } else {
    update(2 * v, l, (l + r) / 2, pos, val);
    update(2 * v + 1, (l + r) / 2 + 1, r, pos, val);
    st[v] = st[2 * v] * st[2 * v + 1];
  }
}
long long int query(long long int v, long long int l, long long int r,
                    long long int tl, long long int tr, long long int mo) {
  if (tr < l || tl > r || tl > tr) {
    return 1;
  }
  if (l == tl && r == tr) {
    return st[v] % mo;
  } else {
    return (((query(2 * v, l, (l + r) / 2, tl, min(tr, (l + r) / 2), mo)) %
             mo) *
            ((query(2 * v + 1, (l + r) / 2 + 1, r, max(tl, (l + r) / 2 + 1), tr,
                    mo)) %
             mo)) %
           mo;
  }
}
long long int maxSubArraySum(vector<long long int> a, long long int size) {
  long long int max_so_far = INT_MIN, max_ending_here = 0, start = 0, end = 0,
                s = 0;
  for (long long int i = 0; i < size; i++) {
    max_ending_here += a[i];
    if (max_so_far < max_ending_here) {
      max_so_far = max_ending_here;
    }
    if (max_ending_here < 0) {
      max_ending_here = 0;
      s = i + 1;
    }
  }
  return max_so_far;
}
long long int solve(long long int d) {
  d++;
  long long int x = 0;
  while (pow(2, x) < d) {
    x++;
  }
  return x;
}
int main() {
  fast();
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> d(n, 0);
    for (long long int i = 0; i < n; i++) {
      cin >> d[i];
    }
    long long int ma = LONG_MIN;
    long long int ans = 0;
    for (long long int i = 0; i < n; i++) {
      if (d[i] < ma) {
        ans = max(ans, solve(ma - d[i]));
      } else {
        ma = d[i];
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
