N = int(eval(input()))

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



cnt = 0

while all(a%2==0 for a 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 all(0 == a%2 for a 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 all(a % 2 == 0 for a 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 all(0 == a % 2 for a in A):
    A = list([x // 2 for x in A])
    cnt += 1
print(cnt)

-while all(a % 2 == 0 for a in A): +while all(0 == a % 2 for a in A):