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.util.*;
import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
public class Solutions {
	 
	static FastScanner scr=new FastScanner();
	static PrintStream out=new PrintStream(System.out);
//	static ArrayList<ArrayList<Integer>>list=new ArrayList<ArrayList<Integer>>();
	public static void main(String []args) {
		int t=scr.nextInt();
		while(t-->0) {
			solve();
		}
	}
	static boolean prime[]=new boolean[2000+1];
	static void solve() {
		int n=scr.nextInt();
		int maxDiff=0;
		int previous=MIN;
		for(int i=0;i<n;i++) {
			int a=scr.nextInt();
			previous=Math.max(previous,a);
			maxDiff=Math.max(maxDiff,previous-a);
		}
		int step=0;
		int power=1;
		while(maxDiff>0) {
			step++;
			maxDiff-=power;
			power*=2;
		}
		out.println(step);
 	}
	static boolean check(int a[],int l,int n) {
		int count[]=new int[l+1];
		for(int i=0;i<n;i++) {
			if(a[i]==l) {
				count[a[i]]=1;
				break;
			}
			count[a[i]]=1;
		}
		for(int i=1;i<=l;i++) {
			if(count[a[i]]==0) {
				return false;
			}
		}
		return true;
	}
	static boolean isPalindrome(String s,int low,int high) {
		
		for(int i=low,j=high;i<j;i++,j--) {
			if(s.charAt(i)!=s.charAt(j)) {
				return false;
			}
		}
		return true;
	}
	static void fill() {
		Arrays.fill(prime,true);
		prime[0]=false;
		prime[1]=false;
		for(int i=2;i<=20000;i++) {
			for(int j=2*i;j<=2000;j+=i) {
				prime[j]=false;
			}
		}
	}
	static void swap(int a[],int i,int j) {
		int temp=a[i];a[i]=a[j];
		a[j]=temp;
	}
	static long modPow(long base,long exp,long mod) {
		if(exp==0) {
			return 1;
		}
		if(exp%2==0) {
			long res=(modPow(base,exp/2,mod));
			return (res*res)%mod;
		}
		return (base*modPow(base,exp-1,mod))%mod;
	}
	static long parse(String s) {
		return Long.parseLong(s);
	}
	static long gcd(long a,long b) {
		if(b==0) {
			return a;
		}
		return gcd(b,a%b);
	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int[] sort(int a[]) {
			Arrays.sort(a);
			return a;
		}
		int []reverse(int a[]){
			int b[]=new int[a.length];
			int index=0;
			for(int i=a.length-1;i>=0;i--) {
				b[index]=a[i];
			}
			return b;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long[] readLongArray(int n) {
			long  [] a=new long  [n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
	static int MAX=Integer.MAX_VALUE;
	static int MIN=Integer.MIN_VALUE;
}class triplet{
	int x;
	int y;
	int z;
	triplet(int fisrt,int second,int third){
		this.x=fisrt;
		this.y=second;
		this.z=third;
	}
}
class pair{
	int x=0;
	int y=0;
	pair(int first,int second){
		this.x=first;
		this.y=second;
	}
}