N=int(eval(input()))

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

ans=0

while 1 not in[a%2 for a in A]:

 A=[a//2 for a in A]

 ans+=1

print(ans)
eval(input())

n=eval(input().replace(' ','|'))

print((len(bin(n&-n))-3))
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
while 1 not in [a % 2 for a in A]:
    A = [a // 2 for a in A]
    ans += 1
print(ans)

eval(input())
n = eval(input().replace(" ", "|"))
print((len(bin(n & -n)) - 3))

-N = int(eval(input())) -A = list(map(int, input().split())) -ans = 0 -while 1 not in [a % 2 for a in A]: -    A = [a // 2 for a in A] -    ans += 1 -print(ans) +eval(input()) +n = eval(input().replace(" ", "|")) +print((len(bin(n & -n)) - 3))