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].
// Working program using Reader Class

import org.omg.Messaging.SYNC_WITH_TRANSPORT;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.*;

public class Main1 {
    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        private void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }

    static class Hero {
        int pow, end;

        Hero(int a, int b) {
            pow = a;
            end = b;
        }
    }

    static class Tree {
        Tree left, right;
        int st, en, max;

        Tree(int a, int b, int c) {
            st = a;
            en = b;
            max = c;
        }
    }

    private static void upd(Tree tr, int pos, int val) {
        tr.max = Math.max(tr.max, val);
        if (tr.st == tr.en) {
            return;
        }
        int mid = (tr.st + tr.en) / 2;
        if (pos <= mid) {
            if (tr.left == null) {
                tr.left = new Tree(tr.st, mid, 0);
            }
            upd(tr.left, pos, val);
        } else {
            if (tr.right == null) {
                tr.right = new Tree(mid + 1, tr.en, 0);
            }
            upd(tr.right, pos, val);
        }
    }

    private static int query(Tree tr, int lo, int hi) {
        if (tr == null) {
            return 0;
        }
        if (tr.st == lo && tr.en == hi) {
            return tr.max;
        }
        int mid = (tr.st + tr.en) / 2;
        if (hi <= mid) {
            return query(tr.left, lo, hi);
        }
        if (lo > mid) {
            return query(tr.right, lo, hi);
        }
        return Math.max(query(tr.left, lo, mid), query(tr.right, mid + 1, hi));
    }

    private static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    static int find(int a, int[] par) {
        if (par[a] == 0) {
            return a;
        }
        return par[a] = find(par[a], par);
    }

    static void union(int a, int b, int[] par, int[] rank) {
        if (rank[a] >= rank[b]) {
            par[b] = a;
            rank[a] += rank[b];
        } else {
            par[a] = b;
            rank[b] += rank[a];
        }
    }

    public static void main(String[] args) throws IOException {
        Reader z = new Reader();
        int t = z.nextInt();
        while (t-- > 0) {
            int n = z.nextInt(), i, lo=0, hi=63, mid, ans=hi+1, temp;
            long j, k;
            int[] a = new int[n];
            for(i=0;i<n;i++){
                a[i]=z.nextInt();
            }
            while(lo<=hi){
                mid=(lo+hi)/2;
                long[] b = new long[n];
                for(i=0;i<n;i++){
                    b[i]= (long) a[i];
                }
                temp=0;
                for(i=1;i<n;i++){
                    while(b[i]<b[i-1]){
                        j=b[i-1]-b[i];
                        k=(int)(Math.log(j*1.0)/Math.log(2.0));
                        if(k>mid-1){
                            break;
                        }
                        temp=(int)Math.max(temp, k+1);
                        b[i]+=Math.pow(2, k);
                    }
                    if(b[i]<b[i-1]){
                        break;
                    }
                }
                if(i==n){
                    ans=temp;
                    hi=temp-1;
                }
                else{
                    lo=mid+1;
                }
            }
            System.out.println(ans);
        }
        z.close();
    }
}