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())
cnt=0

if a==b==c and a%2==0:
  print(-1)
   
else:
  while 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
  print(cnt)

Solution (Python):
A,B,C = map(int,input().split())
count = 0
while A%2 == 0 and B%2 == 0 and C%2 == 0 and count < 10**5:
  A_copy = A
  B_copy = B
  A = (B+C)/2
  B =(A_copy+C)/2
  C = (A_copy+B_copy)/2
  count += 1
if count == 10**5:
  print(-1)
else:
  print(count)

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

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

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

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

Solution (Python):
a = list(map(int,input().split()))
cna = cnb = 0
a.sort()
x = a[2]-a[1]
y = a[1]-a[0]
if a[0]*a[1]*a[2]%2 != 0:
    print(0)
    exit()
while True:
    if x%2 == 0 and x != 0:
        cna += 1
        x //= 2
    else:
        break
while True:
    if y%2 == 0 and y != 0:
        cnb += 1
        y //= 2
    else:
        break
if cna == 0 and cnb == 0:
    print(-1)
else:
    print(min(cna,cnb))

Solution (Python):
"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""

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

Solution (Python):
"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""

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

Solution (Python):
A, B, C = map(int, input().split())
X = (A|B|C)^(A&B&C)
ans = (X&-X).bit_length()-1
print(0 if (A|B|C)&1 else ans)

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

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

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

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

Solution (Python):



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

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

def check(A, B, C):
    return A%2 == 1 or B%2 == 1 or C%2 == 1

ans = 0
while check(A, B, C) == False:
    nA = (B + C) / 2
    nB = (A + C) / 2
    nC = (A + B) / 2
    A, B, C = nA, nB, nC
    ans += 1

print(ans)

Solution (Python):
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

a, b, c = LI()






def distribute(a,b,c):
    x = a/2
    y = b/2
    z = c/2

    a2 = y + z
    b2 = x + z
    c2 = x + y

    if a == a2 and b == b2 and c == c2:
        print(-1)
        sys.exit()
    return a2, b2, c2

count = 0

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

print(count)

Solution (Python):
a, b, c = map(int,input().split())
count = 0
def exchange(a, b, c, count):
    a, b, c = int((b+c)/2), int((a+c)/2), int((a+b)/2)
    count += 1
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        return a, b, c, count
    else:
        return exchange(a, b, c, count)
if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
    print(0) 
elif a == b == c:
    print(-1)
else:
    aa, bb, cc, count = exchange(a, b, c, count)
    print(count)

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

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

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

cnt = 0

while True:
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        break
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b and b == c and c == a:
        cnt = -1
        break

    a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2
    cnt += 1

print(cnt)

Solution (Python):








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







nowA=A
nowB=B
nowC=C
count=0
if A%2==1 or B%2==1 or C%2==1:
    print(0)
elif A==B==C :
    print(-1)
else:
    while True:
        nowA=B//2+C//2
        nowB=A//2+C//2
        nowC=A//2+B//2
        A=nowA
        B=nowB
        C=nowC
        count+=1
        if nowA%2==1 or nowB%2==1 or nowC%2==1:
            print(count)
            exit()

Solution (Python):

import sys


def solve(A: int, B: int, C: int):
    ans = 0
    s = set()
    while True:
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            print(ans)
            break
        newA =  B / 2 + C / 2
        newB =  A / 2 + C / 2
        newC =  A / 2 + B / 2
        A = newA
        B = newB
        C = newC
        ans += 1
        n = ','.join(map(str, [A, B, C]))
        if n in s:
            print("-1")
            break
        s.add(n)

    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())
cnt = 0
while True:
  if A%2!=0 or B%2!=0 or C%2!=0:
    print(cnt)
    break
  elif A == B and B == C and A == C:
    print(-1)
    break
  else:
    temp_A = A
    temp_B = B
    A = B/2 + C/2
    B = temp_A/2 + C/2
    C = temp_A/2 + temp_B/2
    cnt += 1

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

a=0
D=set()
while True:
    if A%2!=0 or B%2!=0 or C%2!=0:
        break
    if (A,B,C) in D:
        a=-1
        break
    else:
        D.add((A,B,C))
    p=(B+C)/2
    q=(A+C)/2
    r=(A+B)/2
    A=p;B=q;C=r
    a+=1
print(a)

Solution (Python):
a,b,c=map(int,input().split())
for i in range(500000):
    if a%2==1 or b%2==1 or c%2==1:
        print(i);exit()
    
    else:
      p=(b+c)//2 ;q=(a+c)//2 ; r=(a+b)//2
      a=p ; b=q;c=r
else:
    print(-1)

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

times = 0
if a == b and b == c and a % 2 == 0:
    print(-1)
else:
    while 1:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        a, b, c = int((b + c)/2), int((c + a)/2), int((a + b)/2)
        times += 1

    print(times)

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

cnt = 0

if (ABC[0] == ABC[1] == ABC[2]) and (ABC[0]%2 == ABC[1]%2 == ABC[2]%2 == 0):
    print(-1)
    exit()
else:
    while True:
        if ABC[0]%2 == ABC[1]%2 == ABC[2]%2 == 0:
            ABC[0], ABC[1], ABC[2] = (ABC[1]+ABC[2])//2, (ABC[0]+ABC[2])//2, (ABC[0]+ABC[1])//2
            cnt += 1
        else:
            break
 
print(cnt)

Solution (Python):

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

cnt = 0

if A==B==C==1:
    pass
elif A==B==C:
    cnt = -1
else:
    while A%2 == 0 and B%2 == 0 and C%2 == 0:
        A,B,C = (B+C)//2,(C+A)//2,(A+B)//2 
        cnt += 1

print(cnt)

Solution (Python):


def main():
    a, b, c = map(int, input().split())
    ans = 0

    if a == b and b == c and a % 2 == 0:
        ans = -1
    else:
        while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            d = b / 2 + c / 2
            e = c / 2 + a / 2
            f = a / 2 + b / 2
            a, b, c = d, e, f
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

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

while a%2==0 and b%2==0 and c%2==0:
    if a == b == c :
        cnt = -1
        break
    ta,tb,tc = a,b,c
    a = tb/2 + tc/2
    b = ta/2 + tc/2
    c = ta/2 + tb/2
    cnt += 1

print(cnt)

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

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

Solution (Python):
import sys
import copy
a = [int(c) for c in input().split()]
cnt=0
while True:
    if a[0]==a[1] and a[1]==a[2] and a[0] != 1:
        print(-1)
        sys.exit(0)
    
    if a[0]%2 == 0 and a[1]%2 == 0 and a[2]%2 == 0:
        b = copy.deepcopy(a)
        a[0] = int((b[1]+b[2])/2)
        a[1] = int((b[2]+b[0])/2)
        a[2] = int((b[0]+b[1])/2)
    else:
        print(cnt)
        sys.exit(0)

    cnt+=1

Solution (Python):
a,b,c=map(int,input().split());print(len(bin((e:=a-b|c-b)&-e))-3or~c%-2)

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

ans = 0
while True:
    if l[0]%2 or l[1]%2 or l[2]%2:
        break
    a = (l[1] + l[2]) // 2
    b = (l[0] + l[2]) // 2
    c = (l[0] + l[1]) // 2
    if l == [a, b, c]:
        ans = -1
        break
    l = [a, b, c]
    ans += 1

print(ans)

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

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

Solution (Python):
def exchange(a, b, c):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        return 0

    if a == b == c:
        return -1

    return exchange((b + c) / 2, (c + a) / 2, (a + b) / 2) + 1


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

    ans = exchange(a, b, c)

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

import sys
input=sys.stdin.readline

def main():
    a,b,c = map(int,input().split())
    count=0

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

    while True:
        if a == b ==c:
            print(-1)
            exit()
        elif a % 2 ==0 and b % 2==0 and c % 2 ==0:
            tmp_a=a/2
            tmp_b=b/2
            tmp_c=c/2
            a=tmp_b+tmp_c
            b=tmp_a+tmp_c
            c=tmp_b+tmp_a
            count+=1
        else:
            break
    print(count)

if __name__=="__main__":
    main()

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

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

i = 0
Ap = A
Bp = B
Cp = C
while A%2 == 0 and B%2 == 0 and C%2 == 0:
  A = Bp//2 + Cp//2 
  B = Ap//2 + Cp//2 
  C = Bp//2 + Ap//2 
  i += 1
  Ap = A
  Bp = B
  Cp = C
  if A == B == C:
    i = -1
    break


print(i)

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

if A % 2 == 1 and B % 2 == 1 and C % 2 == 1:
    print(0)
    exit()
elif A == B and B == C:
    print('-1')
    exit()
else:
    ans = 0
    while A % 2 != 1 and B % 2 != 1 and C % 2 != 1:
        a = B//2+C//2
        b = C//2+A//2
        c = A//2+B//2
        A, B, C = a, b, c
        ans += 1
print(ans)

Solution (Python):

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

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

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

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

  cnt = 0
  while (a % 2 == 0) and (b % 2 == 0) and (c % 2 == 0):
    
    a1,b1,c1 = a,b,c
    a = (b1+c1)//2
    b = (a1+c1)//2
    c = (a1+b1)//2
    
    if [a,b,c] == s:
      return -1
    
    cnt += 1
    
    
  return cnt    
    

ans = main()
print(ans)

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

while a%2 + b%2 + c%2 == 0:
    na = (b + c) // 2
    nb = (a + c) // 2
    nc = (a + b) // 2
    
    if [na,nb,nc] == s:
        ans = -1
        break
        
    else:
        a = na
        b = nb
        c = nc
        ans += 1
        
print(ans)

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

Solution (Python):
A,B,C =map(int,input().split())
con = 0
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
  print(0)
  exit()
if A == B and B == C:
  print(-1)
  exit()
while True:
  if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    break
  con += 1
  D = A / 2
  E = B / 2
  F = C / 2
  A = E + F
  B = D + F
  C = D + E
  
print(con)

Solution (Python):
a,b,c = map(int, input().split())
if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
  print(0)
else:
  for i in range(10**6):
    temp1 = a
    temp2 = b
    temp3 = c
    a = int((temp2+temp3)/2)
    b = int((temp1+temp3)/2)
    c = int((temp1+temp2)/2)
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
      break
  if i == 10**6 - 1:
    print(-1)
  else:
    print(i+1)

Solution (Python):
a,b,c = map(int,input().split())
if a%2 == 1 or b%2 == 1 or c%2== 1 :
    print(0)
    exit()
elif a == b and b == c :
    print(-1)
    exit()
count = 0
while (a%2 == 0 and b%2 == 0 and c%2 == 0) :
    count += 1
    x = (a+b)/2
    y = (b+c)/2
    z = (c+a)/2
    a = x
    b = y
    c = z


print(count)

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

count = 0
while(A%2==0 and B%2==0 and C%2==0):
  if A==B==C:
    count = -1
    break
    
  tot = A+B+C
  A = (tot-A)/2
  B = (tot-B)/2
  C = (tot-C)/2
  count+=1

print(count)

Solution (Python):
import sys
A, B, C = [int(x) for x in input().split()]
ans = 0
if(A==B==C)and(A%2==0)and(B%2==0)and(C%2==0):
  print(-1)
  sys.exit()
while (A%2==0)and(B%2==0)and(C%2==0):
  a = B/2 + C/2
  b = C/2 + A/2
  c = A/2 + B/2
  A, B, C = a, b, c
  ans += 1
print(ans)

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

cnt=0
for _ in range(10**5):
    if a%2==1 or b%2==1 or c%2==1:
        print(cnt)
        exit()
    a,b,c=b//2+c//2,c//2+a//2,a//2+b//2
    cnt+=1
print(-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 True:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        a,b,c = (b/2+c/2), (a/2+c/2), (a/2+b/2)
        ans += 1
    print(ans)

Solution (Python):
a, b, c = list(map(int, input().split()))
l = [a, b, c]


time_of_exchange = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
	
	if a == b == c:
		time_of_exchange = -1
		break
	
	a = (l[1] + l[2]) / 2
	b = (l[0] + l[2]) / 2
	c = (l[0] + l[1]) / 2
	l = [a, b, c]
	
	time_of_exchange += 1
	
print(time_of_exchange)

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

ans = 0
while (a % 2 == 0) & (b % 2 == 0) & (c % 2 == 0):
    a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
    ans += 1
    if ans>1000000:
        ans = -1
        break
print(ans)

Solution (Python):
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
elif a==b==c:
    print(-1)
else:
    total=0
    while True:
        x=a/2
        y=b/2
        z=c/2
        a=y+z
        b=x+z
        c=x+y
        total+=1
        if a%2!=0 or b%2!=0 or c%2!=0:
            print(total)
            break

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

if a%2==1 or b%2==1 or c%2==1:
  print(0)
  exit()
if a==b==c:
  print(-1)
  exit()
ans=0
while a%2==0 and b%2==0 and c%2==0:
    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())
tmpA = 0
tmpB = 0
tmpC = 0
count = 1
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
  print(0)
  exit()
if A == B and A == C and B == C:
  print(-1)
  exit()

while True:
  tmpA = (B + C) / 2
  tmpB = (A + C) / 2
  tmpC = (A + B) / 2
  if tmpA % 2 == 1 or tmpB % 2 == 1 or tmpC % 2 == 1:
    break
  else:
    A = tmpA
    B = tmpB
    C = tmpC
    count += 1
print(count)

Solution (Python):
def main():
    x = list(map(int, input().split()))
    counter = 0

    while x[0] % 2 == 0 and x[1] % 2 == 0 and x[2] % 2 == 0:
        if x[0] == x[1] and x[1] == x[2] and x[2] == x[0]:
            counter = -1
            break
        share_0 = x[0] / 2
        share_1 = x[1] / 2
        share_2 = x[2] / 2
        x[0] = share_1 + share_2
        x[1] = share_0 + share_2
        x[2] = share_0 + share_1
        counter += 1

    print(counter)


if __name__ == "__main__":
    main()

Solution (Python):
li = list(map(int,input().split()))
nx = [0,0,0]
ans = 0
if all(x&1 == 0 for x in li) and li[0] == li[1] == li[2]:
    print(-1)
else:
    while 1:
        if(li[0]%2!=0 or li[1]%2!=0 or li[2]%2!=0):
            break
        nx[0] = (li[1] + li[2])/2
        nx[1] = (li[0] + li[2])/2
        nx[2] = (li[0] + li[1])/2
        li = nx.copy()
        ans += 1
    print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

ans = 0
pattern = set()
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    p = tuple(sorted((a, b, c)))
    if p in pattern:
        print(-1)
        sys.exit(0)
    pattern.add(p)
    a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
    ans += 1

print(ans)

Solution (Python):
import sys
a,b,c = map(int,input().split())
ans = 0
pa = []
pb = []
while True:
  if a%2 == 1 or b%2 == 1 or c%2 == 1:
    break
  ans += 1
  lasta = a
  lastb = b
  lastc = c
  a = lastb/2 + lastc/2
  b = lasta/2 + lastc/2
  c = lasta/2 + lastb/2
  for i in range(len(pa)):
    if pa[i] == a:
      if pb[i] == b:
        print(-1)
        sys.exit()
  pa.append(a)
  pb.append(b)
print(ans)

Solution (Python):
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    global a,b,c
    st = {(a,b,c)}
    count = 0
    while a%2==0 and b%2==0 and c%2==0:
        ta = b//2 + c//2
        tb = a//2 + c//2
        tc = a//2 + b//2
        if (ta,tb,tc) in st:
            print(-1)
            return
        st.add((ta,tb,tc))
        a = ta
        b = tb
        c = tc
        count += 1
    print(count)
    return

if __name__=='__main__':
    a,b,c = IL()
    solve()

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

Solution (Python):

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

print (cnt)

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

Solution (Python):
A,B,C=map(int,input().split())
initial = list([A, B, C])
initial.sort()
n=0
while True:
    if A%2==0 and B%2==0 and C%2==0:
        n+=1
        A_half = A//2
        B_half = B//2
        C_half = C//2
        A = B_half + C_half
        B = C_half + A_half
        C = A_half + B_half
        now = list([A, B, C])
        now.sort()
        if now == initial:
            n = -1
            break
    else:
        break

print(n)

Solution (Python):
import numpy as np
lis=np.array(list(map(int,input().split())))
cnt=0
for i in range(1000000):
    if lis[0]%2==0 and lis[1]%2==0 and lis[2]%2==0:
        if lis[0]==lis[1]==lis[2]:
            print('-1')
            break
        else:   
            lis=lis/2
            a=lis[1]+lis[2]
            b=lis[0]+lis[2]
            c=lis[0]+lis[1]
            lis[0]=a
            lis[1]=b
            lis[2]=c
            cnt+=1
    else:
        print(cnt)
        break

Solution (Python):
A, B, C = map(int, input().split())
sum = 0
before = set()
while True:
    if str(A)+' '+str(B)+' '+str(C) in before:
        print(-1)
        exit()
    else:
        before.add(str(A)+' '+str(B)+' '+str(C))
    if A%2==1 or B%2==1 or C%2==1:
        print(sum)
        exit()
    temp1 = int(B/2)+int(C/2)
    temp2 = int(A/2)+int(C/2)
    temp3 = int(A/2)+int(B/2)
    A, B, C = temp1, temp2, temp3
    sum += 1

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

Solution (Python):
'''
Created on 2020/08/21

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  A,B,C=map(int,pin().split())
  ans=0
  while True:
    if A%2==1 or B%2==1 or C%2==1:
      print(ans)
      break
    if A==B and A==C:
      print(-1)
      break
    a=A 
    b=B 
    c=C 
    A=b//2+c//2
    B=a//2+c//2
    C=a//2+b//2
    ans+=1
  return 
main()

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

if a%2!=0 or b%2!=0 or c%2!=0:
  print(0)
  exit()
elif a==b==c:
  print(-1)
  exit()
    
ans=0  

while a%2==0 and b%2==0 and c%2==0:
  num_a,num_b,num_c=a/2,b/2,c/2
  a=num_b+num_c
  b=num_a+num_c
  c=num_a+num_b
  ans+=1
print(ans)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

l=list(map(int,input().split()))
for i in range(10**6):
    for k in range(3):
        if l[k]%2:
            print(i)
            exit()
    a=[0]*3
    for k in range(3):
        a[k]=(l[(k+1)%3]+l[(k+2)%3])//2
    l=a
print(-1)

Solution (Python):
A, B, C = map(int, input().split())
count = 0
ABC = []
while True:
    if A % 2 ==0 and B % 2 == 0 and C % 2 == 0:
        nA = B/2 + C/2
        nB = A/2 + C/2
        nC = A/2 + B/2
        A, B, C = nA, nB, nC
        count += 1
        if [A, B, C] in ABC:
            count = -1
            break
        ABC.append([A, B, C])
    else:
        break
print(count)

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

if a != 1 and a == b == c:
  print(-1)
  exit()
  
result = 0

while True:
  if any([a & 1, b & 1, c & 1]):
    break
    
  a2 = a // 2
  b2 = b // 2
  c2 = c // 2
  a = b2 + c2
  b = a2 + c2
  c = a2 + b2
  result += 1

print(result)

Solution (Python):
A,B,C = [int(i) for i in input().split()]

if A%2+B%2+C%2 != 0:
    print(0)
    exit()


p = [set([A,B,C])]
cnt = 1
while True:
    a = B//2+C//2
    b = A//2+C//2
    c = A//2+B//2
    if a%2+b%2+c%2 != 0:
        print(cnt)
        exit()
    if set([a,b,c]) in p:
        print(-1)
        exit()
    else:
        p.append(set([a,b,c]))
        A = a
        B = b
        C = c
        cnt += 1

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

empty = [0] * 3
count = 0
if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    print(-1) 
elif (A % 2 != 0) or (B % 2 != 0) or (C % 2 != 0):
    print(0)
else:
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: 
        count += 1
        A_ = A//2
        B_ = B//2
        C_ = C//2
        A = B_ + C_
        B = A_ + C_
        C = A_ + B_

    print(count)

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

if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
    exit()

if a==b==c:
    print(-1)
    exit()

times=0
while a%2==0 and b%2==0 and c%2==0:
    times+=1
    a_=a//2
    b_=b//2
    c_=c//2
    a=b_+c_
    b=a_+c_
    c=a_+b_

print(times)

Solution (Python):
a, b, c = map(int, input().split())
if a == b == c:
    if a % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 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
        cnt += 1
    print(cnt)

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

Solution (Python):
def existOdd(lst):
    for i in lst:
        if i%2==1:
            return False
    return True

cookie=list(map(int,input().split()))
seen=[]
res=0
while existOdd(cookie):
    seen.append(cookie)
    cookie=[cookie[1]/2+cookie[2]/2,cookie[0]/2+cookie[2]/2,cookie[0]/2+cookie[1]/2]
    if cookie in seen:
        res=-1
        break
    res+=1

print(res)

Solution (Python):
def f(a,b,c):
  if a%2+b%2+c%2>0:
    return 0
  if a==b==c:
    return -1
  return f((b+c)//2,(c+a)//2,(a+b)//2)+1

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

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

Solution (Python):
import sys

input = sys.stdin.readline


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

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

    ans = 0
    while True:
        if (A % 2 == 1) or (B % 2 == 1) or (C % 2 == 1):
            break
        ans += 1
        A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
def exchg(a, b, c):
	count = 0
	if (a == b == c) and ((a & 1) == 0 and (b & 1) == 0 and (c & 1) == 0):
		return -1
	while((a & 1) == 0 and (b & 1) == 0 and (c & 1) == 0):
		a, b, c = (a+b)//2, (b+c)//2, (c+a)//2
		
		count += 1
	return count
a, b, c = map(int, input().split())
print(exchg(a, b, c))

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

cnt = 0
while A%2 == 0 and B%2 == 0 and C%2 == 0:
  tmp1 = B/2 + C/2
  tmp2 = C/2 + A/2
  tmp3 = A/2 + B/2
  A = tmp1
  B = tmp2
  C = tmp3
  cnt += 1
  if cnt >= 10**4:
    print("-1")
    sys.exit()
print(cnt)

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

if a == b == c:
  if a % 2 == 1:
    print(t)
  else:
    print(-1)

else:
  while (a % 2 + b % 2 + c % 2) == 0:
    a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2
    t += 1

  print(t)

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

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(0)
elif a==b and b==c:
    print(-1)
    sys.exit(0)
ans=0
for i in range(1,10000):
    x=a//2
    y=b//2
    z=c//2
    a=y+z
    b=x+z
    c=x+y
    if a%2==1 or b%2==1 or c%2==1:
        ans=i
        break
print(ans)

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