import math

N = int(eval(input()))

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

A = list(a)



min = 10**10

for e in A:

    m=0 #eが2で割り切れる回数

    while e%2==0:

        e = e/2

        m+=1

    if min>m:

        min = m

print(min)
n = eval(input())

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

ans = float("inf")

for i in a:

    ans = min(ans, len(bin(i)) - bin(i).rfind("1")-1)

print(ans)
import math

N = int(eval(input()))
a = list(map(int, input().split()))
A = list(a)
min = 10**10
for e in A:
    m = 0  # eが2で割り切れる回数
    while e % 2 == 0:
        e = e / 2
        m += 1
    if min > m:
        min = m
print(min)

n = eval(input())
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(ans)

-import math - -N = int(eval(input())) +n = eval(input()) -A = list(a) -min = 10**10 -for e in A: -    m = 0  # eが2で割り切れる回数 -    while e % 2 == 0: -        e = e / 2 -        m += 1 -    if min > m: -        min = m -print(min) +ans = float("inf") +for i in a: +    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1) +print(ans)