N = int(eval(input()))

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

result = float('inf')

for i in range(N):

  r=0

  while A[i]%2==0:

    A[i]=A[i]/2

    r +=1

  result=min(result,r)

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

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

answer=float('inf')

for i in range(N):

  cut=len(bin(A[i]))-bin(A[i]).rfind('1')-1

  answer=min(answer,cut)

print(answer)
N = int(eval(input()))
A = [int(x) for x in input().split()]
result = float("inf")
for i in range(N):
    r = 0
    while A[i] % 2 == 0:
        A[i] = A[i] / 2
        r += 1
    result = min(result, r)
print(result)

N = int(eval(input()))
A = [int(x) for x in input().split()]
answer = float("inf")
for i in range(N):
    cut = len(bin(A[i])) - bin(A[i]).rfind("1") - 1
    answer = min(answer, cut)
print(answer)

-result = float("inf") +answer = float("inf") -    r = 0 -    while A[i] % 2 == 0: -        A[i] = A[i] / 2 -        r += 1 -    result = min(result, r) -print(result) +    cut = len(bin(A[i])) - bin(A[i]).rfind("1") - 1 +    answer = min(answer, cut) +print(answer)