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].
from math import factorial as fac
from collections import defaultdict
from copy import deepcopy
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin


# def print_case_iterable(case_num, iterable):
	# print("Case #{}: {}".format(case_num," ".join(map(str,iterable))))

# def print_case_number(case_num, iterable):
	# print("Case #{}: {}".format(case_num,iterable))

def print_iterable(A):
	print (' '.join(A))

def read_int():
	return int(f.readline())
def read_int_array():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def read_string():
	return list(f.readline().strip())

NUMBER = 10**9 + 7
# NUMBER = 998244353
def factorial(n) : 
	M = NUMBER
	f = 1
  
	for i in range(1, n + 1):  
		f = (f * i) % M # Now f never can  
						# exceed 10^9+7  
	return f
def mult(a,b):
	return (a * b) % NUMBER

def minus(a , b):
	return (a - b) % NUMBER

def plus(a , b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		g, y, x = egcd(b % a, a)
		return (g, x - (b // a) * y, y)

def modinv(a):
	m = NUMBER
	g, x, y = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m

def is_perfect_square(num):
	for i in range(2,20):
		for j in range(1, num+1):
			if j ** i == num:
				return True
	return False
	# return num ** int(math.log(num)) ** 2 == num

def get_sum_perfect(num):
	res = 0
	for i in range(1,num+1):
		if num % i == 0:
			if is_perfect_square(i):
				res += i	
	return res

def real_solution(n):
	res = 0
	for i in range(1,n+1):
		res += get_sum_perfect(i)
	return res

default_progs = [modinv(4), modinv(4), modinv(4)]
from random import randint

DEBUG = False
def solution1(N):
	# s = set()
	# primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67]
	result = N % NUMBER
	klom = (int(N ** (1/3))+2)
	for num in range(2,klom):
		if num in s:
			continue
		x = num ** 2
		power = num**2
		for p in range(2,int(math.log(N,num))+2):
			# s.add(power)
			result = plus(result, mult(N//power,power))
			power*=num
	# for num in range(klom,(int(N ** (1/3))+2)):
	# 	if num in s:
	# 		continue
	# 	x = num ** 2
	# 	for p in range(4,int(math.log(N,num))+2):
	# 		power = num**p
	# 		s.add(power)
	# 		result = plus(result, mult(N//power,power))
	for num in range(klom,2*(int(N ** (1/3))+2)):
		result = plus(result, N*N*N)
	return result % NUMBER

def solution(A, N):
	if N == 1:
		return 0
	max_diff = A[0] - A[1]
	curr_max = A[0]
	for x in A:
		curr_max = max(curr_max, x)
		max_diff = max(max_diff, curr_max - x)

	if max_diff <= 0:
		return 0

	return int(math.ceil(math.log2(max_diff + 1)))


def main():
	T = read_int()
	for i in range(T):
		N = read_int()  
		A = read_int_array()
		print(solution(A, N))

def main1():
	T = read_int()  
	for i in range(T):
		N = read_int()  
		print(solution(N))
		# print(real_solution(N))

if __name__ == '__main__':
	main()

# # print('yo')
# for i in range(1000, 1001):
# 	realsol = real_solution(i)
# 	sol = solution(i)
# 	if realsol != sol:
# 		print(f'{i}\t{realsol}\t{sol}')#, '\t', realsol - sol)
# print(real_solution(14))
# print(solution(14))
