n=int(eval(input()))

A=list(map(int,input().split()))

c=0

loop=True

while(loop):

    for a in A:

        if a%2!=0:

            loop=False

            break

    if loop:

        A = list([i//2 for i in A])

        c+=1

    else:

        break

print(c)
n=int(eval(input()))

A=list(map(int,input().split()))

c=0

while(all([a%2==0 for a in A])):

    A = list([i//2 for i in A])

    c+=1

print(c)
n = int(eval(input()))
A = list(map(int, input().split()))
c = 0
loop = True
while loop:
    for a in A:
        if a % 2 != 0:
            loop = False
            break
    if loop:
        A = list([i // 2 for i in A])
        c += 1
    else:
        break
print(c)

n = int(eval(input()))
A = list(map(int, input().split()))
c = 0
while all([a % 2 == 0 for a in A]):
    A = list([i // 2 for i in A])
    c += 1
print(c)

-loop = True -while loop: -    for a in A: -        if a % 2 != 0: -            loop = False -            break -    if loop: -        A = list([i // 2 for i in A]) -        c += 1 -    else: -        break +while all([a % 2 == 0 for a in A]): +    A = list([i // 2 for i in A]) +    c += 1