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

public class practice {

    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[100001]; // 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++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
    public static void debug(int[][] arr) {
        int r = arr.length;
        int c = arr[0].length;
        int i,j;
        for(i=0;i<r;++i) {
            for(j=0;j<c;++j)  System.err.print(arr[i][j]+" ");
            System.err.println();
        }
    }
    public static void debug(long[][] arr) {
        int r = arr.length;
        int c = arr[0].length;
        int i,j;
        for(i=0;i<r;++i) {
            for(j=0;j<c;++j)  System.err.print(arr[i][j]+" ");
            System.err.println();
        }
    }
    public static void debug(int ...var) {
        for(int i:var)  System.err.print(i+" ");
        System.err.println();
    }
    public static void debug(String ...var) {
        for(String i:var)  System.err.print(i+" ");
        System.err.println();
    }
    public static void debug(double ...var) {
        for(double i:var)  System.err.print(i+" ");
        System.err.println();
    }
    
    public static void debug(long ...var) {
        for(long i:var)  System.err.print(i+" ");
        System.err.println();
    }

    private static Reader scan = new Reader();

    public static void main(String args[]) throws Exception{
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        //StringBuilder sb = new StringBuilder();

        //be careful of readLine() length of string;
        //Scanner scan = new Scanner(System.in);
        //scan.useDelimiter("");  // for reading character by character

        int t = scan.nextInt();
        int[] a = new int[100000];
        while(t-->0) {

            int n = scan.nextInt();
            int s = 0;
            for(int i=0;i<n;++i) {
                a[i]=scan.nextInt();
            }
            int max = a[0];
            for(int i=1;i<n;++i) {
                if(a[i]>max) {
                    max = a[i];
                } else{
                    s=Math.max(max-a[i],s);
                }
            }

            int twoPow = (1<<31);
            int i = 31;
            for(;i>=0;--i) {
                if((twoPow&s)>=1) {
                    break;
                }
                twoPow>>=1;
            }
            out.println(i+1);
        }

        scan.close();
        out.close();

    }
}
