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

e=a-b|b-c

print(((e!=b%2)*len(f'{(e&-e):b}')-1))
a,b,c=list(map(int,input().split()))

e=a-b|b-c

print(((e!=b%2)*len(f'{e&-e:b}')-1))

a, b, c = list(map(int, input().split()))
e = a - b | b - c
print(((e != b % 2) * len(f"{(e&-e):b}") - 1))

a, b, c = list(map(int, input().split()))
e = a - b | b - c
print(((e != b % 2) * len(f"{e&-e:b}") - 1))

-print(((e != b % 2) * len(f"{(e&-e):b}") - 1)) +print(((e != b % 2) * len(f"{e&-e:b}") - 1))