N = int(eval(input()))

A = [int(l) for l in input().split()]



count = 0

k = 0

while True:

    for i in range(N):

        if A[i]/2** k % 2 !=0:

            break

    else:

        count += 1    

        k += 1

        continue

    break



print(count)
N = int(eval(input()))

A = [int(l) for l in input().split()]



count = 0

while True:

    for i in range(N):

        if A[i] / 2 ** count % 2 !=0:

            break

    else:

        count += 1    

        continue

    break



print(count)
N = int(eval(input()))
A = [int(l) for l in input().split()]
count = 0
k = 0
while True:
    for i in range(N):
        if A[i] / 2**k % 2 != 0:
            break
    else:
        count += 1
        k += 1
        continue
    break
print(count)

N = int(eval(input()))
A = [int(l) for l in input().split()]
count = 0
while True:
    for i in range(N):
        if A[i] / 2**count % 2 != 0:
            break
    else:
        count += 1
        continue
    break
print(count)

-k = 0 -        if A[i] / 2**k % 2 != 0: +        if A[i] / 2**count % 2 != 0: -        k += 1