N = int(eval(input()))

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



A_amari = [0]*N

cnt = 0



while(not(1 in A_amari)):

    for i in range(len(A)):

        A_amari[i] = A[i] % 2        

        A[i] = A[i] / 2

    if(not(1 in A_amari)):cnt += 1



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

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



flg = 0

cnt = 0



while (flg == 0):

    for i in a:

        if i%2 == 1:

            flg = 1

    if flg == 1:

        break

    cnt += 1

    a = [i/2 for i in a]



print(cnt)
N = int(eval(input()))
A = list(map(int, input().split(" ")))
A_amari = [0] * N
cnt = 0
while not (1 in A_amari):
    for i in range(len(A)):
        A_amari[i] = A[i] % 2
        A[i] = A[i] / 2
    if not (1 in A_amari):
        cnt += 1
print(cnt)

n = int(eval(input()))
a = list(map(int, input().split()))
flg = 0
cnt = 0
while flg == 0:
    for i in a:
        if i % 2 == 1:
            flg = 1
    if flg == 1:
        break
    cnt += 1
    a = [i / 2 for i in a]
print(cnt)

-N = int(eval(input())) -A = list(map(int, input().split(" "))) -A_amari = [0] * N +n = int(eval(input())) +a = list(map(int, input().split())) +flg = 0 -while not (1 in A_amari): -    for i in range(len(A)): -        A_amari[i] = A[i] % 2 -        A[i] = A[i] / 2 -    if not (1 in A_amari): -        cnt += 1 +while flg == 0: +    for i in a: +        if i % 2 == 1: +            flg = 1 +    if flg == 1: +        break +    cnt += 1 +    a = [i / 2 for i in a]