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].
import java.io.*;
import java.util.*;

public class Main
 {
    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);
            if (System.getProperty("ONLINE_JUDGE") == null) 
            {
            try 
            {
                System.setOut(new PrintStream(new FileOutputStream("output.txt")));
                din = new DataInputStream(new FileInputStream("input.txt"));
            }
              catch (Exception e) {
            }
        }
            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[200]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n') {
                    if (cnt != 0) {
                        break;
                    }
                    else {
                        continue;
                    }
                }
                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++];
        }
 
        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }

    }

Reader read;
public static void main(String[] args) throws IOException
    
    {
        Main obj = new Main();
        obj.run();
        //obj.read = new Reader();
        
    }
        public int getParent(int parent[], int src)
    {
        if(parent[src] != src)
        {
            int ultimateparent = getParent(parent, parent[src]);
            parent[src] = ultimateparent;
            return ultimateparent;
        }
        return src;
    }

    public void union(int parent[], int i, int j, int rank[])
    {

        int root1 = getParent(parent, i);
        int root2 = getParent(parent, j);
        if(rank[root1] == rank[root2])
        {
            parent[root1] = root2;
            rank[root2]++ ;
        }
        else if(rank[root1] > rank[root2])
        {
            parent[root2] = root1;
        }
        else // rank[root2] > rank[root1]
        {
            parent[root1] = root2;
        }
    }
    public String ns() throws IOException
    {
        return(read.readLine());
    }
    public int ni() throws IOException
    {
        return(read.nextInt());
    }
    public double nd() throws IOException
    {
        return(read.nextDouble());
    }
    public long nl() throws IOException
    {
        return(read.nextLong());
    }
    public int[] ai(int n) throws IOException
    {
        int arr[] = new int[n];
        for(int i = 0; i<n; i++)
            arr[i] = read.nextInt();
        return(arr);
    }
    public double[] ad(int n) throws IOException
    {
        double arr[] = new double[n];
        for(int i = 0; i<n; i++)
            arr[i] = read.nextDouble();
        return(arr);
    }
    public long[] al(int n) throws IOException
    {
        long arr[] = new long[n];
        for(int i = 0; i<n; i++)
            arr[i] = read.nextLong();
        return(arr);
    }

    public int log(long x)
    {
        return (int) (Math.log(x) / Math.log(2) + 1e-10);
    }


//---------------------------------------------------------------------------------------------------------------


    public void run() throws IOException
    {
        read = new Reader();

        StringBuilder sb = new StringBuilder();

        int t = ni();
        for(int testcase = 0; testcase < t; testcase++)
        {
            int n = ni();
            long arr[] = al(n);
            long maxDiff = -1;
            long maxTillNow = arr[0];

            for(long i : arr)
            {
                maxTillNow = Math.max(maxTillNow, i);
                maxDiff = Math.max(maxDiff, maxTillNow-i);
            }
            if(maxDiff == 0)
            {
                sb.append(0).append("\n");
                continue;
            }
            int req = log(maxDiff);
            sb.append(req+1).append("\n");
        }
        System.out.println(sb.toString());
}
}