n = int(eval(input()))

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

mincount = 40

count = 0



for i in a:

  while i%2 == 0:

    i = i/2

    count += 1

  if count < mincount:

    mincount = count

  count = 0



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

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

ans,cnt=36,0

for i in range(n):

  while a[i]%2==0:

    a[i]//=2

    cnt+=1

  ans=min(ans,cnt)

  cnt=0

print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
mincount = 40
count = 0
for i in a:
    while i % 2 == 0:
        i = i / 2
        count += 1
    if count < mincount:
        mincount = count
    count = 0
print(mincount)

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

-mincount = 40 -count = 0 -for i in a: -    while i % 2 == 0: -        i = i / 2 -        count += 1 -    if count < mincount: -        mincount = count -    count = 0 -print(mincount) +ans, cnt = 36, 0 +for i in range(n): +    while a[i] % 2 == 0: +        a[i] //= 2 +        cnt += 1 +    ans = min(ans, cnt) +    cnt = 0 +print(ans)