n = int(eval(input()))

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



cnt = 0

while True:

    if n == sum(1 if x % 2 == 0 else 0 for x in a):

        a = list([x//2 for x in a])

        cnt += 1

    else:

        break

print(cnt)

n = int(eval(input()))

# 10**9

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

cnt = 0

while all(x % 2 == 0 for x in a):

    a = list([x//2 for x in a])

    cnt += 1

print(cnt)

n = int(eval(input()))
a = list(map(int, input().split()))
cnt = 0
while True:
    if n == sum(1 if x % 2 == 0 else 0 for x in a):
        a = list([x // 2 for x in a])
        cnt += 1
    else:
        break
print(cnt)

n = int(eval(input()))
# 10**9
a = list(map(int, input().split()))
cnt = 0
while all(x % 2 == 0 for x in a):
    a = list([x // 2 for x in a])
    cnt += 1
print(cnt)

+# 10**9 -while True: -    if n == sum(1 if x % 2 == 0 else 0 for x in a): -        a = list([x // 2 for x in a]) -        cnt += 1 -    else: -        break +while all(x % 2 == 0 for x in a): +    a = list([x // 2 for x in a]) +    cnt += 1