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_list = list(map(int, input().split()))



min_a = min(a_list)

count = 0

while min_a % 2 == 0:

    min_a /= 2

    count += 1

for a in a_list:

    if a % 2 ** count != 0:

        a_count = 0

        while a % 2 == 0:

            a /= 2

            a_count += 1

        count = a_count



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_list = list(map(int, input().split()))
min_a = min(a_list)
count = 0
while min_a % 2 == 0:
    min_a /= 2
    count += 1
for a in a_list:
    if a % 2**count != 0:
        a_count = 0
        while a % 2 == 0:
            a /= 2
            a_count += 1
        count = a_count
print(count)

-N = int(eval(input())) -A = [int(l) for l in input().split()] +n = int(eval(input())) +a_list = list(map(int, input().split())) +min_a = min(a_list) -while True: -    for i in range(N): -        if A[i] / 2**count % 2 != 0: -            break -    else: -        count += 1 -        continue -    break +while min_a % 2 == 0: +    min_a /= 2 +    count += 1 +for a in a_list: +    if a % 2**count != 0: +        a_count = 0 +        while a % 2 == 0: +            a /= 2 +            a_count += 1 +        count = a_count