Problem:
 Score : 300 points    Problem Statement Takahashi, Aoki and Snuke love cookies. They have A , B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:   Each person simultaneously divides his cookies in half and gives one half to each of the other two persons.   This action will be repeated until there is a person with odd number of cookies in hand.  How many times will they repeat this action?
Note that the answer may not be finite.      Constraints  1 ≤ A,B,C ≤ 10^9         Input Input is given from Standard Input in the following format:  A  B  C       Output Print the number of times the action will be performed by the three people, if this number is finite.
If it is infinite, print -1 instead.        Sample Input 1 4 12 20      Sample Output 1 3  Initially, Takahashi, Aoki and Snuke have 4 , 12 and 20 cookies. Then,   After the first action, they have 16 , 12 and 8 .  After the second action, they have 10 , 12 and 14 .  After the third action, they have 13 , 12 and 11 .   Now, Takahashi and Snuke have odd number of cookies, and therefore the answer is 3 .       Sample Input 2 14 14 14      Sample Output 2 -1       Sample Input 3 454 414 444      Sample Output 3 1

Solution (Python):
a,b,c=map(int,input().split())
if a==b==c and a%2==0 and b%2==0 and c%2==0:
    print(-1)
else:
    ans=0
    while a%2==0 and b%2==0 and c%2==0:
        A=a
        B=b
        C=c
        a=B//2+C//2
        b=A//2+C//2
        c=B//2+A//2
        ans+=1
        if a==b==c:
            ans=-1
            break
    print(ans)

Solution (Python):
a, b, c = map(int, input().split())

if a == b and a == c:
	if a % 2 == 1:
		print(0)
		exit()
	else:
		print(-1)
		exit()
	
ans = 0
s, t, u = 0, 0, 0
while a%2==0 and b%2==0 and c%2==0:
	s = b//2 + c//2
	t = a//2 + c//2
	u = a//2 + b//2
	a, b, c = s, t, u
	ans += 1
	
print(ans)

Solution (Python):
a,b,c = map(int,input().split())


ans = 0
while True:
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(ans)
        import sys
        sys.exit()
    if a == b and b== c:
        print(-1)
        import sys
        sys.exit()
    ans += 1
    a,b,c = b // 2 + c // 2, a // 2 + c // 2,a // 2 + b // 2

Solution (Python):
A,B,C=map(int,input().split())

t=0
while(True):
    if(A%2==1 or B%2==1 or C%2==1) :
        break
    a=(A+B)/2
    b=(B+C)/2
    c=(C+A)/2
    if(A==a and B==b and C==c):
        print(-1)
        exit()
    A=a
    B=b
    C=c
    t+=1
print(t)

Solution (Python):
from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
num = 0

while True:
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        print(count)
        exit()
    elif a==b==c:
        print(-1)
        exit()
    else:
        a,b,c = b//2+c//2,c//2+a//2,a//2+b//2
        count += 1
    num += 1

Solution (Python):
A,B,C=map(int,input().split())
count=0
if A==B==C and A%2==0:
    print(-1)
    exit()
while A%2==0 and B%2==0 and C%2==0:
    A,B,C=B//2+C//2,A//2+C//2,B//2+C//2
    count+=1
print(count)

Solution (Python):
a,b,c = map(int,input().split())
loop = [[a,b,c]]
count = 0
for i in range(200):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    x = a // 2
    y = b // 2
    z = c // 2
    a = y + z
    b = x + z
    c = x + y
    count += 1
    if [a,b,c] in loop:
        count = -1 
        break
    loop.append([a,b,c])
print(count)

Solution (Python):
a,b,c=map(int,input().split())
cnt=0
if any((a%2==1,b%2==1,c%2==1)):
  print(0)
  exit()
if a==b==c and a%2==0:
  print(-1)
  exit()
while a%2==b%2==c%2==0:
  a,b,c=(b+c)/2,(a+c)/2,(a+b)/2
  cnt+=1
print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

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

if a%2==0 and b%2==0 and c%2==0 and (a == b == c):
	print(-1)
	sys.exit()
cnt = 0
while True:
	if a%2==1 or b%2==1 or c%2==1:
		break
	a,b,c = (b+c)//2,(a+c)//2,(b+c)//2
	cnt += 1

print(cnt)

Solution (Python):
A,B,C = map(int, input().split())

def all_even(a,b,c):
	if a%2 == 0 and b%2 == 0 and c%2 == 0:
		return True
	else:
		return False

cnt = 0

while all_even(A,B,C):
	if A == B == C:
		cnt = -1
		break
	cnt+=1
	A,B,C = (B+C)//2, (A+C)//2, (A+B)//2
	
print(cnt)

Solution (Python):
A, B, C = map(int, input().split())
for i in range(100):
    if A%2 == 0 and B%2 == 0 and C%2 == 0:
        A, B, C = B+C>>1, C+A>>1, A+B>>1
    else:
        print(i)
        break
else:
    print(-1)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    a, b, c = LI()
    d = defaultdict(int)
    d[(a, b, c)] = 1
    ans = 0
    while 1:
        if a & 1 or b & 1 or c & 1: break
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
        ans += 1
        if d[(a, b, c)]:
            print(-1)
            return
        d[(a, b, c)] = 1
    print(ans)
    return



if __name__ == '__main__':
    solve()

Solution (Python):
A,B,C = map(int,input().split())
if A%2==1 or B%2==1 or C%2==1:
    print(0)
elif A==B and A==C:
    print(-1)
else:
    a = 0
    while A%2==0:
        A //= 2
        a += 1
    b = 0
    while B%2==0:
        B //= 2
        b += 1
    c = 0
    while C%2==0:
        C //= 2
        c += 1
    cnt = min(a,b,c)
    if [a,b,c].count(cnt)<3:
        print(cnt)
    else:
        print(cnt+1)

Solution (Python):
A,B,C=map(int,input().split())
cnt=0
while True:
    if A % 2 == B % 2 == C % 2 == 1:
        break
    elif A==B==C:
        cnt-=1
        break
    elif A%2==B%2==C%2==0:
        hA=A//2
        hB=B//2
        hC=C//2
        A=hB+hC
        B=hA+hC
        C=hA+hB
        cnt+=1
    else:
        break

print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

def main():
	A = MAP()
	if A[0] % 2 or A[1] % 2 or A[2] % 2:
		print(0)
	elif A[0] == A[1] and A[0] == A[2]:
		print(-1)
	else:
		cnt = 0
		while all(a%2 == 0 for a in A):
			a = A[0]//2 + A[1]//2
			b = A[1]//2 + A[2]//2
			c = A[0]//2 + A[2]//2
			A[0] = a
			A[1] = b
			A[2] = c
			cnt += 1
			
			

		print(cnt)

if __name__ == '__main__':
	main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



A,B,C = map(int,read().split())

for t in range(500):
    if A&1 or B&1 or C&1:
        break
    A,B,C = A//2,B//2,C//2
    A,B,C = B+C,C+A,A+B

answer = t if t < 400 else -1
print(answer)

Solution (Python):
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(2*10**5):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        
        if i==199999:
            ans=-1
    print(ans)

Solution (Python):
a,b,c=map(int,input().split())
for i in range(10**6):
  if a%2==1 or b%2==1 or c%2==1:
    print(i)
    exit()
  a,b,c=(b+c)//2,(c+a)//2,(a+b)//2
print(-1)

Solution (Python):
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b, c = list(map(int, input().rstrip('\n').split()))
    if a == b == c:
        if a == b == c == 1:
            print(0)
        else:
            print(-1)
    else:
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            cnt = 0
            while True:
                if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
                    cnt += 1
                    a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
                else:
                    break
            print(cnt)
        else:
            print(0)


if __name__ == '__main__':
    solve()

Solution (Python):
a,b,c = map(int, input().split( ))

a2,b2,c2 = a,b,c
cnt = 0
while True:
    if a2%2 or b2%2 or c2%2:
        print(cnt)
        exit()
    else:
        a = (b2+c2)//2
        b = (c2+a2)//2
        c = (a2+b2)//2
        
        cnt += 1
        if {a,b,c}=={a2,b2,c2}:
            print(-1)
            exit()
        a2 = a
        b2 = b
        c2 = c

Solution (Python):
a,b,c = [int(i) for i in input().split()]
total = a + b + c
ct = 0

if a == b == c and total % 2 == 0: 
    print(-1)
elif a == b == c and total % 2 == 1:
    print(0)
else:
    while True:
        a = (total - a)/2
        b = (total - b) /2
        c = (total - c) /2
        
        if a.is_integer() and b.is_integer() and c.is_integer():
            ct += 1
        else:
            break
        
    print(ct)

Solution (Python):

A, B, C = map(int, input().split(' '))

if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    print(0)
    exit()

ans = 0
while True:
    A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2
    ans += 1

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break

    if ans > 50:
        ans = -1
        break
    

print(ans)

Solution (Python):
from fractions import gcd
a,b,c=map(int,input().split())
if a%2 or b%2 or c%2:
  print(0)
  exit()
if a==b==c:
  print(-1)
  exit()
x=abs(a-b)
y=abs(b-c)
z=abs(c-a)
t=gcd(gcd(x,y),z)
for i in range(1,100):
  if t%2:
    print(i-1)
    break
  else:
    t=t//2

Solution (Python):
A, B, C = map(int, input().split())
dA, dB, dC = B - C, C - A, A - B
Ex = 0
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
  Ex = 0
elif A == B and B == C:
  Ex = -1
else:
  while dA % 2 == 0 and dB % 2 == 0 and dC % 2 == 0:
    dA //= 2
    dB //= 2
    dC //= 2
    Ex += 1
print(Ex)

Solution (Python):
A, B, C = map(int, input().split())
if A == B == C and A % 2 == 0 :
  print(-1)
else :
  ret = 0
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0 :
    A, B, C = B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2
    ret += 1

  print(ret)

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b, c = list(map(int, readline().split()))
    if a == b == c:
        if a == b == c == 1:
            print(0)
        else:
            print(-1)
    else:
        cnt = 0
        while True:
            if a % 2 == b % 2 == c % 2 == 0:
                cnt += 1
                a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
            else:
                print(cnt)
                exit()


if __name__ == '__main__':
    solve()

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(A: int, B: int, C: int):

    ans = 0
    while(A%2 == 0 and B%2 == 0 and C%2 == 0):
        oA, oB, oC = A, B, C
        A2, B2, C2 = A//2, B//2, C//2
        A = B2 + C2
        B = A2 + C2
        C = A2 + B2
        if A == oA and B == oB and C == oC:
            print('-1')
            exit()
        ans += 1

    print(ans)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    solve(A, B, C)

if __name__ == '__main__':
    main()

Solution (Python):
A,B,C= map(int,input().split())
if A==B and B==C and A%2==0:
  print(-1)
else:
  ans = 0
  while A%2==0 and B%2==0 and C%2==0:
    tmpA = A//2
    tmpB = B//2
    tmpC = C//2
    A = tmpB + tmpC
    B = tmpA + tmpC
    C = tmpA + tmpB
    ans += 1
  print(ans)

Solution (Python):

import sys

A,B,C = map(int,input().split())

if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    print (0)
    sys.exit()


for i in range(100000):

    na = A
    nb = B
    nc = C

    A = (nb+nc) // 2
    B = (na+nc) // 2
    C = (na+nb) // 2

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print (i+1)
        sys.exit()

print (-1)

Solution (Python):
A, B, C = map(int, input().split())
tmpA, tmpB, tmpC = A, B, C

ans = 0
while tmpA%2 == 0 and tmpB%2 == 0 and tmpC%2 == 0:
    ans += 1
    nxtA = (tmpB + tmpC) // 2
    nxtB = (tmpA + tmpC) // 2
    nxtC = (tmpA + tmpB) // 2
    tmpA, tmpB, tmpC = nxtA, nxtB, nxtC
    if nxtA == A and nxtB == B and nxtC == C:
        ans = -1
        break

print(ans)

Solution (Python):
a, b, c = map(int, input().split())

ans = 0
while a%2 == 0 and b%2 == 0 and c%2 == 0:
    if a == b == c:
        ans = -1
        break

    a, b, c = int(b/2)+int(c/2), int(a/2)+int(c/2), int(a/2)+int(b/2)
    ans += 1

print(ans)

Solution (Python):
a, b, c = map(int, input().split())

ans = 0
while 1:
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(ans)
        exit()
    if a == b == c:
        print(-1)
        exit()
    else:
        a, b, c = b // 2 + c // 2, a // 2 + c // 2, a //2 + b //2
        ans += 1

Solution (Python):
a,b,c = map(int,input().split())

if any((a%2==1,b%2==1,c%2==1)):
    print(0)
    exit()
    
cnt = 0
while cnt <= 100:
    a,b,c = (b+c)/2, (a+c)/2,(a+b)/2
    cnt += 1
    if any((a%1!=0,b%1!=0,c%1!=0)):
        print(cnt-1)
        exit()
print(-1)

Solution (Python):
a,b,c=map(int,input().split())
cnt=0
while a%2+b%2+c%2==0:
 a,b,c=(b+c)/2,(c+a)/2,(a+b)/2
 if a==b==c:
  print(-1)
  exit()
 cnt+=1
print(cnt)

Solution (Python):
a,b,c=map(int,input().split())
if a%2==1 or b%2==1 or c%2==1:
 print(0)
 exit()
cnt=1
while True:
 aa=a
 bb=b
 cc=c
 a=(bb+cc)/2
 b=(cc+aa)/2
 c=(aa+bb)/2
 if a%2==1 or b%2==1 or c%2==1:
  print(cnt)
  exit()
 elif a==b==c:
  print(-1)
  exit()
 else:
  cnt+=1

Solution (Python):
a, b, c = map(int, input().split())

if a == b and b == c and a % 2 == 0:
    print(-1)
    exit()

ans = 0
while True:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        ans += 1
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
    else:
        break

print(ans)

Solution (Python):
import sys
a,b,c=map(int,input().split())
i=0
while a%2==0 and b%2==0 and c%2==0:
    a,b,c=(b+c)//2,(a+c)//2,(a+b)//2
    i+=1
    if i==10000:
        print(-1)
        sys.exit()
print(i)

Solution (Python):
a,b,c=map(int,input().split())
ans=0
while 1:
  if a%2>0 or b%2>0 or c%2>0:
    break
  if a==b and b==c:
    ans=-1
    break
  a,b,c=b//2+c//2,c//2+a//2,a//2+b//2
  ans+=1
print(ans)

Solution (Python):
a, b, c = map(int, input().split())

cnt = 0
for i in range(50000000):
    if a%2 + b%2 + c%2 >= 1:
        print(cnt)
        break
    new_a = (b + c) // 2
    new_b = (c + a) // 2
    new_c = (a + b) // 2
    a, b, c = new_a, new_b, new_c
    cnt += 1
else:
    print(-1)

Solution (Python):
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

a, b, c = ril()
if a == b == c:
    if a * b * c % 2 == 1:
        print(0)
    else:
        print(-1)
    exit()

count = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
    count += 1
print(count)

Solution (Python):
def examA():
    A, B, C = LI()
    S = A+B+C
    cur = 0
    for i in range(32):
        if A%2==1 or B%2==1 or C%2==1:
            break
        A = (S-A)//2
        B = (S-B)//2
        C = (S-C)//2
        cur +=1
    if cur==32:
        ans = -1
    else:
        ans = cur
    print(ans)

import sys,copy,bisect,itertools,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Solution (Python):
A,B,C = map(int,input().split())
ans = 0
while A%2+B%2+C%2==0:
    if A==B==C:
        ans = -1
        break
    A,B,C = (B+C)//2,(C+A)//2,(A+B)//2
    ans += 1
print(ans)

Solution (Python):
a, b, c = map(int, input().split())
if a == b == c and a%2==0:
  print("-1")
else:
  ans = 0
  while True:
    if a%2 or b%2 or c%2:
      print(ans)
      break
    at, bt, ct = a, b, c
    a = bt//2 + ct//2
    b = ct//2 + at//2
    c = at//2 + bt//2
    ans += 1

Solution (Python):
A,B,C=map(int,input().split())
target=[A,B,C]
START=sorted([A,B,C])

def checkIfInfinite(tar):
  tar=sorted(tar)
  for i in range(len(tar)):
    if tar[i]!=START[i]:
      return False
  return True

def checkIfEnd(tar):
  for t in tar:
    if t%2==1:
      return True
    
ans=0
while True:
  if checkIfEnd(target):
    print(ans)
    exit(0)
  Ahalf=target[0]//2
  Bhalf=target[1]//2
  Chalf=target[2]//2
  target[0]=Bhalf+Chalf
  target[1]=Chalf+Ahalf
  target[2]=Ahalf+Bhalf
  ans+=1
  if checkIfInfinite(target):
    print(-1)
    exit(0)

Solution (Python):
a, b, c = map(int, input().split())
ans = 0
if a == b == c and a%2 == 0:
  print(-1)
else:
  while (a%2 or b%2 or c%2) == 0 :
    tmp1 = a
    tmp2 = b
    a = b/2 + c/2
    b = tmp1/2 + c/2
    c = tmp1/2 + tmp2/2
    ans += 1
  print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a = inpl()
cnt = 0
for i in a:
    if i%2:
        print(cnt)
        quit()
if a[0] == a[1] == a[2]:
    print(-1)
else:
    while True:
        for i in a:
            if i%2:
                print(cnt)
                quit()
        b = [0] * 3
        b[0] = (a[1] + a[2]) // 2
        b[1] = (a[0] + a[2]) // 2
        b[2] = (a[1] + a[0]) // 2
        cnt += 1
        a[::] = b[::]

Solution (Python):
A, B, C = map(int, input().split())


if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
    print(0)
    exit()
else:
    if A == B and B == C:
        print(-1)
        exit()
    else:
        ans = 0
        while True:        

            ans += 1

            a = (B+C)/2
            b = (A+C)/2
            c = (A+B)/2

            if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
                print(ans)
                exit()
            
            A = a
            B = b
            C = c

Solution (Python):
a,b,c=map(int,input().split())
ans=0
for _ in range(10**6):
    if sum(i%2 for i in [a,b,c])==0:
        A=b//2+c//2
        B=c//2+a//2
        C=a//2+b//2
        ans+=1
        a,b,c=A,B,C
    else:
        print(ans)    
        exit()
print(-1)

Solution (Python):
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(2*10**5):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        
        if i==199999:
            ans=-1
    print(ans)

Solution (Python):
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



A, B, C = list(map(int, sys.stdin.buffer.readline().split()))

ans = 0
while not (A & 1 or B & 1 or C & 1):
    A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2
    ans += 1
    if ans >= 1000000:
        print(-1)
        exit()
print(ans)

Solution (Python):
a,b,c = map(int,input().split())
ans = 0

while True:
    if a%2 == 0 and b%2 == 0 and c%2 == 0:
        pass
    else:
        print(ans)
        exit()
    
    last_a = a
    last_b = b
    last_c = c
    a,b,c = (b+c)//2, (a+c)//2, (a+b)//2
    
    ans += 1
    
    if last_a == a and last_b == b and last_c == c:
        print(-1)
        exit()

Solution (Python):


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


def is_continue(x_list):
    for x in x_list:
        if x % 2 == 1:
            return False
    return True


count = 0

while is_continue([A, B, C]):
    if A == B and B == C:
        count = -1
        break
    a, b, c = A, B, C
    a = B // 2 + C // 2
    b = A // 2 + C // 2
    c = A // 2 + B // 2
    A, B, C = a, b, c
    count += 1

ans = count
print(ans)

Solution (Python):

A, B, C = map(int, input().split())
ans = 1
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    print(0)
    exit()

if A == B == C:
    print(-1)
    exit()

ans = 1
while 1:
    a = B // 2 + C // 2
    b = C // 2 + A // 2
    c = A // 2 + B // 2
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    else:
        A = a
        B = b
        C = c
        ans += 1
print(ans)

Solution (Python):
a,b,c=map(int,input().split())
import sys
if a%2+b%2+c%2>0:
    print(0)
    sys.exit()
e=0

while e<10000:
    a,b,c=b//2+c//2,a//2+c//2,a//2+b//2
    e+=1
    if a%2+b%2+c%2>0:
        break

if e==10000:
    print(-1)
else:
    print(e)

Solution (Python):
def main():
    a, b, c = map(int, input().split())

    cnt = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and cnt < 100:
        a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
        cnt += 1

    if cnt == 100:
        cnt = -1

    print(cnt)


if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np

A, B, C = map(int, input().split())

ans = 0
T = A + B + C
s = np.array([A, B, C])
while all(s % 2 == 0):
    if A == B == C:
        print(-1)
        exit(0)
    s = (T - s) // 2
    ans += 1

print(ans)

Solution (Python):
a,b,c=map(int,input().split())
if a==1 and b==1 and c==1:
    print(0)
    exit()
if a==b==c:
    print(-1)
    exit()
v=[a,b,c]
v.sort()
tmp=[b-a,c-a,c-b]
ans=10**10
for i in range(len(tmp)):
    cnt=0
    while(tmp[i]%2==0):
        tmp[i]=tmp[i]//2
        cnt+=1
    ans=min(ans,cnt)

print(ans)

Solution (Python):
def main():
    a, b, c = (int(i) for i in input().split())
    ans = 0
    finite = True
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        next_a = b//2 + c//2
        next_b = a//2 + c//2
        next_c = a//2 + b//2
        if next_a == a and next_b == b and next_c == c:
            print(-1)
            finite = False
            break
        ans += 1
        a = next_a
        b = next_b
        c = next_c
    if finite:
        print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
a, b, c = map(int, input().split())
if(a == b and b == c):
  if(a % 2 == 0):
    print(-1)
  else:
    print(0)
  exit()

result = 0

while(True):
  A = (b + c) / 2
  B = (c + a) / 2
  C = (a + b) / 2
  if((b - a) % 2 > 0 or (c - b) % 2 > 0 or (a - c) % 2 > 0):
    print(result)
    break
  a, b, c = A, B, C
  result += 1

Solution (Python):
abc=sorted(list(map(int,input().split())))
pabc=abc[:]
ans=0
while True:
    if abc[0]%2==1 or abc[1]%2==1 or abc[2]%2==1:
        print(ans)
        exit()
    ans+=1
    abc[0]=pabc[1]//2+pabc[2]//2
    abc[1]=pabc[0]//2+pabc[2]//2
    abc[2]=pabc[0]//2+pabc[1]//2
    abc=sorted(abc)
    if abc[0]==pabc[0] and abc[1]==pabc[1] and abc[2]==pabc[2]:
        print(-1)
        exit()
    pabc=abc[:]

Solution (Python):
a, b, c = map(int, input().split())

ans = 0
flag = False
while True:
    if a == b == c and a % 2 == 0:
        flag = True
        break
    elif a % 2 == b % 2 == c % 2 == 0:
        a, b, c = b//2 + c//2, c//2 + a//2, a//2 + b//2
        ans += 1
    else:
        break

if flag:
    print(-1)
else:
    print(ans)

Solution (Python):
a, b, c = map(int, input().split())

ans = 0
while a % 2 != 1 and b % 2 != 1 and c % 2 != 1:
    if a == (b+c)//2 and b == (a+c)//2 and c == (a+b)//2:
        ans = -1
        break
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    ans += 1

print(ans)

Solution (Python):
l=list(map(int,input().split()))

for i in range(3):
    if l[i]%2==1:
        print(0)
        exit()

if l.count(l[0])==3:
    if l[0]%2==0:
        print(-1)
        exit()
    else:
        print(0)
        exit()

count=0
while True:
    temp=list(map(lambda x:x%2,l))
    all=sum(temp)
    if all==3:
        print(count+1)
        exit()
    elif all==2:
        print(count)
        exit()
    elif all==1:
        print(count)
        exit()
    l=list(map(lambda x:x//2,l))
    count+=1

Solution (Python):
l=list(map(int,input().split()))

if l.count(l[0])==3:
    if l[0]%2==0:
        print(-1)
        exit()
    else:
        print(0)
        exit()

count=0
while True:
    temp=list(map(lambda x:x%2,l))
    all=sum(temp)
    if all==3:
        print(count+1)
        exit()
    elif all==2:
        print(count)
        exit()
    elif all==1:
        print(count)
        exit()
    l=list(map(lambda x:x//2,l))
    count+=1

Solution (Python):
a,b,c = map(int,input().split())
if a == b and b == c:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    ans = 0
    while True:
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            ans += 1
            A = b / 2 + c / 2
            B = c / 2 + a / 2
            C = a / 2 + b / 2
            a = A
            b = B
            c = C
        else:
            break
    print(ans)

Solution (Python):
a, b, c = map(int,input().split())

def aa():
    if a == b and a == c:
        if a % 2 == 0:
            return -1
        else:
            return 0
    else:
        A = [a-b, b-c, c-a]
        j = 0
        while True:
            for i in range(3):
                if A[i] % 2 == 1:
                    return j
                else:
                    A[i] //= 2
            j += 1

print(aa())

Solution (Python):
a , b , c = map(int,input().split())
n = 0

for i in range(10000):
    if a == b and b == c and a % 2 == 0:
        n -= 1
        break
    elif a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    else:
        a , b , c = (b + c) / 2 , (c + a) / 2 , (a + b) / 2
        n += 1
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break

print(n)

Solution (Python):
A, B, C = map(int, input().split())
a = A + B + C
ans = 0

if A == B == C and A % 2 == 0:
    print(-1)
else:
    while A % 2 == B % 2 == C % 2 == 0:
        A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2
        ans += 1
    print(ans)

Solution (Python):
def change(a,b,c):
    a1=b//2+c//2
    b1=a//2+c//2
    c1=a//2+b//2
    return a1,b1,c1
a,b,c = map(int,input().split())
if a==b and b==c and a%2==0:
    print(-1)
    exit()
cnt=0
while a%2==0 and b%2==0 and c%2==0:
    a,b,c=change(a,b,c)
    cnt+=1
    if a==b and b==c and a%2==0:
        print(-1)
        exit()
print(cnt)

Solution (Python):
A,B,C=list(map(int,input().split()))
if A==B==C and A%2==0:
    print(-1)
else:
    cnt=0
    while A%2==B%2==C%2==0:
        A,B,C=(B+C)//2,(C+A)//2,(A+B)//2
        cnt+=1
    print(cnt)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    a, b, c = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    if a == b == c:
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            print(-1)
        else:
            print(0)
    else:
        while True:
            if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
                a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
                cnt += 1
            else:
                print(cnt)
                exit()


if __name__ == '__main__':
    slove()

Solution (Python):
import math


def resolve():
    a, b, c = map(int, input().split())
    if a == b == c:
        if a % 2:
            print(0)
        else:
            print(-1)
        return 0
    for i in range(int(math.log2(10 ** 9)) + 1):
        if a % 2 or b % 2 or c % 2:
            print(i)
            return 0
        a_new, b_new, c_new = (b + c) // 2, (a + c) // 2, (a + b) // 2,
        a, b, c = a_new, b_new, c_new
    print(-1)


if __name__ == "__main__":
    resolve()

Solution (Python):
import time
t1=time.time()
a,b,c=map(int,input().split())
cnt=0
while a%2==0 and b%2==0 and c%2==0:
	a,b,c=b//2+c//2,a//2+c//2,a//2+b//2
	cnt+=1
	t2=time.time()
	if t2-t1>1.97:
		print(-1)
		exit()
print(cnt)

Solution (Python):
a, b, c = map(int, input().split())

for i in range(10 ** 9):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i)
        exit()
    if a == b == c:
        print(-1)
        exit()
    a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2

Solution (Python):
ABC = list(map(int, input().split()))
cnt = 0
while all(map(lambda x: x % 2 == 0, ABC)) == True:
  ABC = [(ABC[1] + ABC[2]) // 2, (ABC[2] + ABC[0]) // 2, (ABC[0] + ABC[1]) // 2]
  cnt += 1
  if len(set(ABC)) == 1:
    print(-1)
    exit()
print(cnt)

Solution (Python):
A, B, C = map(int, input().split())

if A % 2 == B % 2 == C % 2 == 0:
    if A == B == C:
        print(-1)
    else:
        ans = 0
        while A % 2 == B % 2 == C % 2 == 0:
            S = A + B + C
            A, B, C = (S - A) // 2, (S - B) // 2, (S - C) // 2
            ans += 1
        print(ans)
else:
    print(0)

Solution (Python):
A,B,C=map(int,input().split());d=0
if A%2:print(0);quit()
if A==B==C:print(-1);quit()
while A%2==B%2==C%2==0:A,B,C=B//2+C//2,C//2+A//2,A//2+B//2;d+=1
print(d)

Solution (Python):
A=list(map(int,input().split()))


def odd_check(a):
  for aa in a:
    if aa%2:
      return 1
  return 0

if odd_check(A):
  print(0)
  exit()
  
if A[0]==A[1]==A[2]:
  print(-1)
  exit()
  
ans=0
while 1:
  A[0],A[1],A[2]=A[1]//2+A[2]//2,A[0]//2+A[2]//2,A[1]//2+A[0]//2
  
  ans+=1
  if odd_check(A):
    print(ans)
    exit()

Solution (Python):
def solve(a, b, c):
    for i in range(1000):
        if (a % 2 == 1) or (b % 2 == 1) or (c % 2 == 1):
            return i
        a, b, c = b//2 + c//2, c//2 + a//2, a//2 + b//2
    return -1

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

Solution (Python):
a,b,c=map(int,input().split())

cnt=0
t=[]
while True:
	if a%2!=0 or b%2!=0 or c%2!=0:
		print(cnt)
		break
	cnt+=1
	a,b,c=b//2+c//2, a//2+c//2, a//2+b/2
	if [a,b,c] not in t:t.append([a,b,c])
	else:
		print(-1)
		break