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):
def solve(A, B, C):
    if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
        return 0
    elif (A == B == C):
        return -1
    else:
        return solve((B/2 + C/2), (A/2 + C/2), (A/2 + B/2)) + 1

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

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

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

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

ans = 0
if A == B == C and A % 2 == 0:
    ans = -1
else:
    count = 0
    while (A % 2 == B % 2 == C % 2 == 0):
        wA = (B/2 + C/2)
        wB = (A/2 + C/2)
        wC = (A/2 + B/2)
        A = wA
        B = wB
        C = wC
        count += 1
    ans = count

print(ans)

Solution (Python):
a,b,c=map(int,input().split())
aa=[]
bb=[]
cc=[]
ans=0
while a%2==0 and b%2==0 and c%2==0:
  ans+=1
  aa.append(a)
  bb.append(b)
  cc.append(c)
  a,b,c=(b+c)//2,(c+a)//2,(a+b)//2
  if a in aa and b in bb and c in cc:
    print(-1)
    break
else:
  print(ans)

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

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

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:
        break
    if a==b==c:
        ans=-1
        break
    ans+=1
    na=(b+c)/2
    nb=(c+a)/2
    nc=(a+b)/2
    a=na
    b=nb
    c=nc
print(ans)

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

if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
  result = 0
elif A == B == C:
  result = -1
else:
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    result += 1
    a = A/2
    b = B/2
    c = C/2
    A = b + c
    B = a + c
    C = b + a
   
print(result)

Solution (Python):

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

    ans = 0
    a = A
    b = B
    c = C
    while(True):
        x = int((b + c)/ 2)
        y = int((a + c)/ 2)
        z = int((a + b)/2)

        a = x
        b = y
        c = z

        ans += 1

        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            print(ans)
            return
        elif a == A and b == B and c == C:
            print(-1)
            return

solve()

Solution (Python):

a, b, c = list(map(int, input().split(' ')))
cnt = 0
if a == b == c:
    cnt = a%2-1
else:
    while not (a%2 or b%2 or c%2):
        cnt += 1
        a,b,c=(b+c)/2,(a+c)/2,(a+b)/2

print(cnt)

Solution (Python):
A,B,C = list(map(int, input().split()))
count=0
while True:
    if A%2 ==1or B%2 ==1 or C%2 ==1:
        print(count)
        break
    elif  A==B and B==C and C==A:
        print(-1)
        break 
    elif A%2==0 and B%2==0 and C%2 == 0:
        A2 = 0.5*A
        B2 = 0.5*B
        C2 = 0.5*C
        A = B2+C2
        B = C2+A2
        C = A2+B2
        count=count+1

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

def F(A,B,C):
    if any(x&1 for x in [A,B,C]):
        return 0
    if A == B == C:
        return -1
    return 1 + F((A+B)//2,(B+C)//2,(C+A)//2)

answer = F(A,B,C)
print(answer)

Solution (Python):
A,B,C = map(int,input().split())
if A == B == C and A%2 == 0:
  print(-1)
elif A%2 == 1 or B%2 == 1 or C%2 == 1:
  print(0)
else:
  c = 0
  while A%2 == B%2 == C%2 == 0:
    A0 = A
    B0 = B
    C0 = C
    A = (B0+C0)/2
    B = (C0+A0)/2
    C = (A0+B0)/2
    c += 1
  print(c)

Solution (Python):
A,B,C=map(int,input().split())
if A==B==C and A%2==0:
  print(-1)
elif A%2==1 or B%2==1 or C%2==1:
  print(0)
else:
  c=0
  while A%2==B%2==C%2==0:
    A0=A
    B0=B
    C0=C
    A=(B0+C0)/2
    B=(C0+A0)/2
    C=(A0+B0)/2
    c+=1
  print(c)

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


def func(x):
    cnt = 0
    while x % 2 == 0:
        x //= 2
        cnt += 1

    return cnt


if A % 2 or B % 2 or C % 2:
    print(0)
elif A == B == C:
    print(-1)
else:
    m = min(func(A + B), func(B + C), func(C + A))
    print(m)

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

s = set()

cnt = 0
while A % 2 == B % 2 == C % 2 == 0:
    if (A, B, C) in s:
        cnt = -1
        break
    s.add((A, B, C))
    A, B, C = B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2
    cnt += 1

print(cnt)

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

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

Solution (Python):
import math
import sys


def rem(a, b, c):
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        return False
    else:
        return True
def isDouble(a, b, c):
    if (a%1!=0 or b%1!=0 or c%1!=0):
        return False
    else:
        return True
a, b, c = map(int, input().split())
cnt = 0
fa = a
fb = b
fc=c
while True:
    if (cnt != 0 and fa == a and fb == b and fc == c):
        print(-1)
        sys.exit()
    tmp1 = a / 2
    tmp2 = b / 2
    tmp3 = c / 2
    if (not isDouble(tmp1, tmp2, tmp3)):
        break
    cnt += 1
    a = tmp2 + tmp3
    b = tmp1 + tmp3
    c = tmp1 + tmp2
    if (not rem(a, b, c)):
        break
print(cnt)

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

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

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

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

k=0
if A%2==B%2==C%2==0 and A==B==C:
    k=-1
else:
    while A%2==B%2==C%2==0:
        a=A
        b=B
        c=C
        A=(b+c)/2
        B=(a+c)/2
        C=(a+b)/2
        k+=1

print(k)

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

def divide2(x):
    r = 0
    while x%2 == 0:
        r += 1
        x = x/2
    return r

if A == B == C:
    if A%2 == 0:
        print(-1)
    else:
        print(0)
else:
    print(min(divide2(A+B),divide2(B+C),divide2(C+A)))

Solution (Python):
def resolve():
    a,b,c=map(int, input().split())
    if a==c==b and a%2==0:
        print(-1)
    elif a==c==b and a%2==1:
        print(0)
    else:
        cnt=0
        while a%2==b%2==c%2==0:
            a_new=(b+c)//2
            b_new=(a+c)//2
            c_new=(a+b)//2
            a=a_new
            b=b_new
            c=c_new
            cnt+=1
        print(cnt)

resolve()

Solution (Python):
a,b,c = map(int,input().split())
count = 0
temp_a = 0
temp_b = 0
temp_c = 0
init_a = a
init_b = b
init_c = c
while True:
    if a==init_a and b==init_b and c==init_c and count!=0:
        count = -1
        break
    elif a%2==0 and b%2==0 and c%2==0:
         temp_a = a/2
         temp_b = b/2
         temp_c = c/2
         a = temp_b+temp_c
         b = temp_a+temp_c
         c = temp_a+temp_b
         count += 1
    else:
        break
print(count)

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

ans=0
lst=[]
l=[A,B,C]
l.sort()
lst.append(l)
while(1):
    if A%2==1 or B%2==1 or C%2==1:
        print(ans)
        exit()
    a=A
    b=B
    c=C
    A=(b+c)//2
    B=(a+c)//2
    C=(a+b)//2
    ans+=1
    l=[A,B,C]
    
    l.sort()
    for i in range(len(lst)):
        cnt=0
        for j in range(3):
            if lst[i][j]==l[j]:
                cnt+=1
        if cnt==3:
            print(-1)
            exit()

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

while cnt <= 10**6:
    if (a%2 != 0 or b%2 != 0 or c%2 != 0):
        print(cnt)
        exit()
    
    if a==b==c:
        print(-1)
        exit()
    
    a_ = b//2 + c//2
    b_ = a//2 + c//2
    c_ = a//2 + b//2

    a = a_
    b = b_
    c = c_

    cnt += 1

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

while cnt <= 10**6:
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        print(cnt)
        exit()
    
    a_ = b//2 + c//2
    b_ = a//2 + c//2
    c_ = a//2 + b//2

    a = a_
    b = b_
    c = c_

    cnt += 1
print(-1)

Solution (Python):
import numpy as np
import sys

input = sys.stdin.readline

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


if A == B == C and A%2 == 0 and B%2 == 0 and C%2 == 0:
    ans = -1
else:
    ans = 0
    while A%2 == 0 and B%2 == 0 and C%2 == 0:
        next_a = C/2 + B/2
        next_b = A/2 + C/2
        next_c = A/2 + B/2
        A = next_a
        B = next_b
        C = next_c
        ans += 1

print(ans)

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

Solution (Python):
A, B, C = map(int, input().split())
count = 0
fA = A
fB = B
while A%2 == 0 and B%2 == 0 and C%2 == 0:
    hA = A/2
    hB = B/2
    hC = C/2
    A = hB + hC
    B = hA + hC
    C = hA + hB
    count += 1
    if A == fA and B == fB:
        count = -1 
        break

print(count)

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

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

if A == B and B == C:
  print(-1)
  exit()
  
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
  
  if A == B and B == C:
    print(-1)
    exit()
    
print(ans)

Solution (Python):
from statistics import median


from itertools import combinations 
from collections import deque
from collections import defaultdict
from fractions import gcd
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    a,b,c = readInts()
    ab = abs(a-b)
    bc = abs(b-c)
    cnt = 0
    if a == b == c == 1:
        print(0)
        exit()
    if ab == 0 and bc == 0:
        print('-1')
        exit()
    while True:
        if ab % 2 == 0 and bc % 2 == 0:
            ab //= 2
            bc //= 2
            cnt += 1
        else:
            break
    print(cnt)

if __name__ == '__main__':
  main()

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

changed_list = []
now_list = [A, B, C]
ans = 0
flag = True

while flag:
    if now_list in changed_list:
        flag = False
        ans = -1
    else:
        if len([i for i in now_list if not i % 2 == 0]) != 0:
            flag = False
        else:
            changed_list.append(now_list)
            a = now_list[1] / 2 + now_list[2] / 2
            b = now_list[0] / 2 + now_list[2] / 2
            c = now_list[0] / 2 + now_list[1] / 2
            now_list = [a, b, c]

if ans != -1:
    ans = len(changed_list)

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    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:
        res = 0
        while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
            a = B // 2 + C // 2
            b = A // 2 + C // 2
            c = A // 2 + B // 2
            A, B, C = a, b, c
            res += 1

        print(res)


if __name__ == '__main__':
    resolve()

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:
        if A == B == C:
            print(-1)
            exit()
        ans += 1
        tA = A
        tB = B
        tC = C
        A = tB//2 + tC//2
        B = tA//2 + tC//2
        C = tB//2 + tA//2
    else:
        print(ans)
        exit()

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

Solution (Python):
import math
import sys

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

cnt = 0
while(True):
    half_a, half_b, half_c = a / 2, b / 2, c / 2
    ea = a % 2 == 0
    eb = b % 2 == 0
    ec = c % 2 == 0
    if (ea and eb and ec or (not ea) and (not eb) and (not ec)):
        cnt += 1
        a = half_b + half_c
        b = half_a + half_c
        c = half_a + half_b
    else:
        break

print(cnt)

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

if(a == b and b == c and a % 2 == 0):
    print(-1)
else :
    cnt = 0
    while True:
        if(a % 2 != 0 or b % 2 != 0 or c % 2 != 0):
            break
        A = b//2 + c//2
        B = c//2 + a//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())
if A == B == C and A%2 == 0:
  print(-1)
else:
  D = 0
  while A%2 == 0 and B%2 == 0 and C%2 == 0:
    D += 1
    AA = B/2 + C/2
    BB = A/2 + C/2
    CC = A/2 + B/2
    A = AA
    B = BB
    C = CC
  print(D)

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

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

i = 0
a_, b_, c_ = a, b, c

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

print(i)

Solution (Python):
import sys
input = sys.stdin.readline

def readlines(n):
    for _ in range(n):
        yield map(int, input().split())


def main():
    a, b, c = map(int, input().split())
    if a == b == c:
        if a % 2 == 0:
            yield -1
        else:
            yield 0
            
        return

    while all(x%2 == 0 for x in (a, b, c)):
        a_ = a//2
        b_ = b//2
        c_ = c//2
        a, b, c = b_+c_, a_+c_, a_+b_
        yield 1


print(sum(main()))

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

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

else:
    for i in range(1000000000):
        if A %2==0 and B%2==0 and C%2==0:
            a = A/2
            b = B/2
            c = C/2
            A = b+c
            B = a+c
            C = a+b
        else:
            print(i)
            exit()

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

total = a + b + c

if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b == c:
    print(-1)
elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
    print(0)
else:
    count = 1
    while True:
        a, b = (total - a) / 2, (total - b) / 2
        if a % 2 != 0 or b % 2 != 0:
            print(count)
            break
        else:
            count += 1

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:
        print(ans)
        break
    else:
        tmp = [B//2 + C//2, C//2 + A//2, A//2 + B//2]
        if tmp == [A,B,C]:
            print(-1)
            break
        else:
            A,B,C = tmp[0], tmp[1], tmp[2]
            ans += 1

Solution (Python):
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)
    quit()

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

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 b == c and c == a:
    print(-1)
else:
    cnt = 0
    while(True):
        cnt += 1
        ta = b//2 + c //2
        tb = a//2 + c //2
        tc = a//2 + b //2
        if ta %2 == 1 or tb %2 == 1 or tc %2 == 1:
            break
        a,b,c = ta,tb,tc
    print(cnt)

Solution (Python):
A,B,C=map(int,input().split())
if A==B==C and A%2==0: print(-1)
else:
    k=0
    while all(x%2==0 for x in [A,B,C]):
        A,B,C=(B+C)//2,(C+A)//2,(A+B)//2
        k+=1
    print(k)

Solution (Python):
A, B, C = list(map(int, input().split()))
if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 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):
A, B, C = map(int, input().split())

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

count = 0
for i in range(10**9):
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    count += 1
    a = A
    b = B
    c = C
    A = b // 2 + c // 2
    B = a // 2 + c // 2
    C = a // 2 + b // 2

print(count)

Solution (Python):
A, B, C = map(int, input().split())
ans = 0
cont = True
while cont:
    if A == B == C and A%2==0 :
        ans = -1
        break
    elif A%2==0 and B%2==0 and C%2==0:
        b_A = A
        b_B = B
        b_C = C
        A = b_B//2 + b_C//2
        B = b_A//2 + b_C//2
        C = b_A//2 + b_B//2
        ans += 1
    else:
        break
print(ans)

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C = map(int, readline().split())
    ans = 0
    if A==B==C:
        if A%2==0:
            ans = -1
        else:
            ans = 0
    else:
        pre_A = A
        pre_B = B
        pre_C = C
        while pre_A%2==0 and pre_B%2==0 and pre_C%2==0:
            now_A = (pre_B+pre_C)//2
            now_B = (pre_A+pre_C)//2
            now_C = (pre_A+pre_B)//2
            pre_A = now_A
            pre_B = now_B
            pre_C = now_C
            ans += 1
    print(ans)




if __name__ == '__main__':
    main()

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

if A == B == C ==1:
    print(0)

elif A == B == C:
    print(-1)

else:
    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 = a/2 + b/2
        count += 1

    print(count)

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



if A==B and B==C and A%2==1:
  print(0)
  
elif A==B and B==C:
  print(-1)
else:
  count=0
  while A%2==0 and B%2==0 and C%2==0:
    Ax=A/2
    Bx=B/2
    Cx=C/2
    
    A = int(Bx+Cx)
    B = int(Cx+Ax)
    C = int(Ax+Bx)
    count +=1
    
  print(count)

Solution (Python):
a=list(map(int,input().split()))
cnt=0
tmp=[0]*3

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

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

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

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

Solution (Python):
A,B,C = map(int,input().split(' '))
num = 0
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    print(0)
elif A == B == C:
    print(-1)
elif A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        A_c = A
        B_c = B
        C_c = C
        A = B_c /2 + C_c / 2
        B = A_c / 2 + C_c /2
        C = A_c /2 + B_c / 2
        num += 1
    print(num)

Solution (Python):
A,B,C= map(int, input().split())
cot = 0
while True:
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    else:
        tempA = (B + C)//2
        tempB = (A + C)//2
        tempC = (B + A)//2
        A = tempA
        B = tempB
        C = tempC
        cot += 1

        if cot > 1000000:
            print(-1)
            exit(0)
            
print(cot)

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

Solution (Python):
N = list(map(int, input().split()))
N2 = [0,0,0]
ans = 0
while True:
    for i in range(3):
        if  not N[i] %2 == 0:
            print(ans)
            exit()
    N2[0] = (N[1] + N[2]) /2
    N2[1] = (N[0] + N[2]) /2
    N2[2] = (N[0] + N[1]) /2
    
    if N == N2:
        print('-1')
        exit()
    N = N2.copy()
    ans += 1

Solution (Python):

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

cnt = 0

while True:
    prev = abc[:]
    if abc[0] % 2 == 1 or abc[1] % 2 == 1 or abc[2] % 2 == 1:
        break
    tmp = [abc[0]//2,abc[1]//2,abc[2]//2]

    abc = [tmp[1]+tmp[2],tmp[0]+tmp[2],tmp[0]+tmp[1]]
    cnt += 1
    

        
    if abc[0] == prev[0] and abc[1] == prev[1] and abc[2] == prev[2]:
        cnt = -1
        break
    else:
        continue
        
    
        
print(cnt)

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

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


if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print(0)
else:
    ans = 0
    done = set((a, b, c))
    while True:
        ans += 1
        s = a // 2
        t = b // 2
        u = c // 2
        a, b, c = t + u, s + u, s + t
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            print(ans)
            break
        elif (a, b, c) in done:
            print(-1)
            break
        else:
            done.add((a, b, c))

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True

def func(a):
    b = []
    for ai in a:
        for j in reversed(range(30)):
            if (ai >> j) * 2 ** j == ai:
                b.append(j)
                break
    return b

a = LIST()
if len(set(a)) == 1 and not a[0] % 2:
    print(-1)
    exit()
b = func(a)
ans = 0
while True:
    if 0 in b:
        break
    tmp = [0, 0, 0]
    for i in range(3):
        for j in range(3):
            if i == j:
                continue
            tmp[i] += a[j] // 2
    a = tmp
    b = func(a)
    ans += 1
print(ans)

Solution (Python):
a, b, c =map(int, input().split())
i,j,k = a,b,c
X=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()
else:
  while i%2 ==0 and j%2==0 and k%2==0:
    i = (b+c)/2
    j = (c+a)/2
    k = (a+b)/2
    a,b,c = i,j,k
    X +=1
print(X)

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

la = [A]
lb = [B]
lc = [C]

ans = 0
while la[ans] % 2 == 0 and lb[ans] % 2 == 0 and lc[ans] % 2 == 0 and ans < 100001:
    la.append((lb[ans] + lc[ans]) / 2)
    lb.append((lc[ans] + la[ans]) / 2)
    lc.append((la[ans] + lb[ans]) / 2)
    ans += 1

if ans == 100001:
    print(-1)
else:
    print(ans)

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 and b == c and a % 2 == 0:
    print(-1)
else:
    ans = 0
    while (1):
        aa = 0
        bb = 0
        cc = 0
        aa += (b // 2 + c // 2)
        bb += (a // 2 + c // 2)
        cc += (a // 2 + b // 2)
        ans += 1
        if aa % 2 == 1 or bb % 2 == 1 or cc % 2 == 1:
            print(ans)
            exit()
        a = aa
        b = bb
        c = cc

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

ans = 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
    ans += 1
    if ans > 100000:
        ans = -1
        break

print(ans)

Solution (Python):
A,B,C=(map(int,input().split(' ')))
ans = 0
while True:
    if A%2!=0 or B%2!=0 or C%2!=0:
        print(ans)
        break
    if A==B==C:
        print(-1)
        break
    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())
ans = 0 
while 1:
  if (A%2,B%2,C%2) == (0,0,0):
    if A == B == C:
      print(-1)
      break
    else:
      ans += 1
      A,B,C = (B+C)//2,(C+A)//2,(A+B)//2
  else:
    print(ans)
    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 and B == C:
    print(-1)

else:
    step = 0
    while True:
        step += 1
        nA = B // 2 + C // 2
        nB = A // 2 + C // 2
        nC = A // 2 + B // 2
        A, B, C = nA, nB, nC
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            print(step)
            break

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

Solution (Python):


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


debug=1

def pront(*n):
    if debug==1:
        print(n)


if A%2==1 or B%2==1 or C%2==1:
    
    print(0)
    
elif A==B==C:
    
    print(-1)
    
else:
    x=0
    while not(A%2==1 or B%2==1 or C%2==1):
        a=A
        b=B
        c=C
        
        A=(b+c)//2
        B=(a+c)//2
        C=(a+b)//2
        x+=1
    
    print(x)

Solution (Python):
A, B, C = map(int, input().split())
li = [A,B,C]
if A&1 ==1 or B&1 ==1 or C&1 ==1:
    print(0)
else:
    num = 1
    a = (B+C)//2
    b = (A+C)//2
    c = (A+B)//2
    flag = True
    while li != [a,b,c]:
        if a&1 ==1 or b&1 ==1 or c&1 ==1:
            flag = False
            break
        a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
        num += 1
    if flag:
        print(-1)
    else:
        print(num)

Solution (Python):
def is_no_odd(x, y, z):
    return x % 2 == 0 and y % 2 == 0 and z % 2 == 0


def exchange(x, y, z):
    new_x = y / 2 + z / 2
    new_y = x / 2 + z / 2
    new_z = x / 2 + y / 2
    return new_x, new_y, new_z


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

while is_no_odd(a, b, c):
    if a == b == c:
        cnt = -1
        break

    a, b, c = exchange(a, b, c)
    cnt += 1

print(cnt)

Solution (Python):
def main():
    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:
        ans += 1
        A, B, C = (B + C) * 0.5, (A + C) * 0.5, (A + B) * 0.5
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):

a,b,c = map(int,input().split())
cnt = 0
if a%2 == 1 or b%2 == 1 or c%2 == 1:
    print('0')

elif a==b==c and a%2==0:
            print('-1')
    
elif not a==b==c:
    while a%2 == b%2 == c%2 == 0:
        a,b,c = b//2+c//2,c//2+a//2,a//2+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)
else:
    count = 0
    while True:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        count += 1
        temp_a = b // 2 + c // 2
        temp_b = a // 2 + c // 2
        temp_c = a // 2 + b // 2
        a, b, c = temp_a, temp_b, temp_c
    print(count)