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;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
map<long long int, long long int> primeFactors(long long int n) {
  map<long long int, long long int> mp;
  while (n % 2 == 0) {
    mp[2]++;
    n = n / 2;
  }
  for (long long int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      mp[i]++;
      n = n / i;
    }
  }
  if (n > 2) {
    mp[n]++;
  }
  return mp;
}
class LCA {
 public:
  vector<long long int> height, euler, first, segtree;
  vector<bool> visited;
  long long int n;
  LCA(vector<vector<long long int>> &adj, long long int root = 0) {
    n = adj.size();
    height.resize(n);
    first.resize(n);
    euler.reserve(n * 2);
    visited.assign(n, false);
    dfs(adj, root);
    int m = euler.size();
    segtree.resize(m * 4);
    build(1, 0, m - 1);
  }
  void dfs(vector<vector<long long int>> &adj, int node, int h = 0) {
    visited[node] = true;
    height[node] = h;
    first[node] = euler.size();
    euler.push_back(node);
    for (auto to : adj[node]) {
      if (!visited[to]) {
        dfs(adj, to, h + 1);
        euler.push_back(node);
      }
    }
  }
  void build(int node, int b, int e) {
    if (b == e) {
      segtree[node] = euler[b];
    } else {
      int mid = (b + e) / 2;
      build(node << 1, b, mid);
      build(node << 1 | 1, mid + 1, e);
      int l = segtree[node << 1], r = segtree[node << 1 | 1];
      segtree[node] = (height[l] < height[r]) ? l : r;
    }
  }
  int query(int node, int b, int e, int L, int R) {
    if (b > R || e < L) return -1;
    if (b >= L && e <= R) return segtree[node];
    int mid = (b + e) >> 1;
    int left = query(node << 1, b, mid, L, R);
    int right = query(node << 1 | 1, mid + 1, e, L, R);
    if (left == -1) return right;
    if (right == -1) return left;
    return height[left] < height[right] ? left : right;
  }
  int lca(int u, int v, long long int &check) {
    int left = first[u], right = first[v];
    if (left > right) {
      check = 1;
      swap(left, right);
    }
    return query(1, 0, euler.size() - 1, left, right);
  }
};
long long int mult(long long int a, long long int b) {
  return ((a % 1000000007) * (b % 1000000007)) % 1000000007;
}
long long int COUNT(map<long long int, long long int> mp) {
  long long int count = 1;
  for (auto it : mp) {
    count = mult(count, it.second + 1);
  }
  return count;
}
map<long long int, long long int> join(map<long long int, long long int> mp,
                                       map<long long int, long long int> mp1,
                                       map<long long int, long long int> mp2) {
  for (auto it : mp1) {
    mp[it.first] -= it.second;
  }
  for (auto it : mp2) {
    mp[it.first] += it.second;
  }
  return mp;
}
map<long long int, long long int> join1(map<long long int, long long int> mp,
                                        map<long long int, long long int> mp1) {
  for (auto it : mp1) {
    mp[it.first] += it.second;
  }
  return mp;
}
map<long long int, long long int> disjoin(
    map<long long int, long long int> mp,
    map<long long int, long long int> mp1) {
  for (auto it : mp1) {
    mp[it.first] -= it.second;
  }
  return mp;
}
void dfs(vector<long long int> tree[], long long int i,
         map<long long int, long long int> final[], long long int visit[],
         map<long long int, long long int> mp[]) {
  visit[i] = 1;
  for (auto it : mp[i]) {
    final[i][it.first] += it.second;
  }
  for (auto it : tree[i]) {
    if (visit[it]) continue;
    visit[it] = 1;
    final[it] = final[i];
    dfs(tree, it, final, visit, mp);
  }
}
map<long long int, long long int> complete(
    map<long long int, long long int> mp, map<long long int, long long int> mp1,
    map<long long int, long long int> mp2,
    map<long long int, long long int> mp3) {
  mp = join1(mp, mp1);
  mp = disjoin(mp, mp2);
  mp = disjoin(mp, mp2);
  mp = join1(mp, mp3);
  return mp;
}
void print(long long int a, long long int b) { cout << a << " " << b << "\n"; }
void solve() {
  long long int n;
  cin >> n;
  long long int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int bits[40] = {0};
  for (int i = 0; i < n - 1; i++) {
    if (arr[i] < arr[i + 1])
      continue;
    else {
      long long int diff = arr[i] - arr[i + 1];
      long long int m = 0;
      while (diff != 0) {
        if (diff % 2) {
          bits[m]++;
        }
        diff = diff / 2;
        m++;
      }
      arr[i + 1] = arr[i];
    }
  }
  long long int count = 1, prev = 0;
  for (int i = 0; i < 34; i++) {
    if (bits[i] > 0) {
      prev = i + 1;
    }
  }
  cout << prev << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  for (long long int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
