##いろいろやってみよう

import functools

def mod(a,b):

  c=a%b

  return c

N=int(eval(input()))

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

count=0

for j in range(len(bin(max(A)))-2):

  if 1 in list(map(functools.partial(mod,b=2),A)):

    break

  else:

    A=[A[i]//2 for i in range(N)]

    count+=1

print(count)
a=int(eval(input()))

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

counter=0

exist_odd=False

while True:

  count=0

  while count<=a-1:

    if b[count]%2==1:

      exist_odd=True

      break

    else:

      b[count]=b[count]//2

      count+=1

  if exist_odd:

    break

  else:

    counter+=1

print(counter)

    
##いろいろやってみよう
import functools


def mod(a, b):
    c = a % b
    return c


N = int(eval(input()))
(*A,) = list(map(int, input().split()))
count = 0
for j in range(len(bin(max(A))) - 2):
    if 1 in list(map(functools.partial(mod, b=2), A)):
        break
    else:
        A = [A[i] // 2 for i in range(N)]
        count += 1
print(count)

a = int(eval(input()))
b = list(map(int, input().split()))
counter = 0
exist_odd = False
while True:
    count = 0
    while count <= a - 1:
        if b[count] % 2 == 1:
            exist_odd = True
            break
        else:
            b[count] = b[count] // 2
            count += 1
    if exist_odd:
        break
    else:
        counter += 1
print(counter)

-##いろいろやってみよう -import functools - - -def mod(a, b): -    c = a % b -    return c - - -N = int(eval(input())) -(*A,) = list(map(int, input().split())) -count = 0 -for j in range(len(bin(max(A))) - 2): -    if 1 in list(map(functools.partial(mod, b=2), A)): +a = int(eval(input())) +b = list(map(int, input().split())) +counter = 0 +exist_odd = False +while True: +    count = 0 +    while count <= a - 1: +        if b[count] % 2 == 1: +            exist_odd = True +            break +        else: +            b[count] = b[count] // 2 +            count += 1 +    if exist_odd: -        A = [A[i] // 2 for i in range(N)] -        count += 1 -print(count) +        counter += 1 +print(counter)