n = int(eval(input()))

a = [int(i) for i in input().split()]

ans = 0

while not any(i&1 for i in a):

    ans += 1

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



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

a = {int(i) for i in input().split()}

ans = 0

while not any(i&1 for i in a):

    ans += 1

    a = {i//2 for i in a}



print(ans)
n = int(eval(input()))
a = [int(i) for i in input().split()]
ans = 0
while not any(i & 1 for i in a):
    ans += 1
    a = [i // 2 for i in a]
print(ans)

n = int(eval(input()))
a = {int(i) for i in input().split()}
ans = 0
while not any(i & 1 for i in a):
    ans += 1
    a = {i // 2 for i in a}
print(ans)

-a = [int(i) for i in input().split()] +a = {int(i) for i in input().split()} -    a = [i // 2 for i in a] +    a = {i // 2 for i in a}