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

ab = abs(a-b)

bc = abs(b-c)



if a == b == c:

  if a % 2 == 0:

    print((-1))

    exit()

  else:

    print((0))

    exit()



count = 0



while True:

  if ab % 2 != 0 or bc % 2 != 0:

    break

  else:

    ab = ab // 2

    bc = bc // 2

    count += 1



print(count)
c = list(map(int, input().split()))



if len(set(c)) == 1 and c[0] % 2 == 0:

    print((-1))

    exit()



cnt = 0

while c[0] % 2 != 1 and c[1] % 2 != 1 and c[2] % 2 != 1:

    c = [c[1]/2 + c[2]/2, c[0]/2 + c[2]/2, c[0]/2 + c[1]/2]

    cnt += 1

print(cnt)
a, b, c = list(map(int, input().split()))
ab = abs(a - b)
bc = abs(b - c)
if a == b == c:
    if a % 2 == 0:
        print((-1))
        exit()
    else:
        print((0))
        exit()
count = 0
while True:
    if ab % 2 != 0 or bc % 2 != 0:
        break
    else:
        ab = ab // 2
        bc = bc // 2
        count += 1
print(count)

c = list(map(int, input().split()))
if len(set(c)) == 1 and c[0] % 2 == 0:
    print((-1))
    exit()
cnt = 0
while c[0] % 2 != 1 and c[1] % 2 != 1 and c[2] % 2 != 1:
    c = [c[1] / 2 + c[2] / 2, c[0] / 2 + c[2] / 2, c[0] / 2 + c[1] / 2]
    cnt += 1
print(cnt)

-a, b, c = list(map(int, input().split())) -ab = abs(a - b) -bc = abs(b - c) -if a == b == c: -    if a % 2 == 0: -        print((-1)) -        exit() -    else: -        print((0)) -        exit() -count = 0 -while True: -    if ab % 2 != 0 or bc % 2 != 0: -        break -    else: -        ab = ab // 2 -        bc = bc // 2 -        count += 1 -print(count) +c = list(map(int, input().split())) +if len(set(c)) == 1 and c[0] % 2 == 0: +    print((-1)) +    exit() +cnt = 0 +while c[0] % 2 != 1 and c[1] % 2 != 1 and c[2] % 2 != 1: +    c = [c[1] / 2 + c[2] / 2, c[0] / 2 + c[2] / 2, c[0] / 2 + c[1] / 2] +    cnt += 1 +print(cnt)