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 and b == c and a%2 == 0:
    print(-1)
    exit()
else:
    t = True
    ans = 0
    while t:
        if a%2+b%2+c%2 > 0:
            print(ans)
            break
        else:
            ans += 1
            A = (b+c)//2
            B = (c+a)//2
            C = (a+b)//2
            a = A
            b = B
            c = C

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 == 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):



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


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

    
    
    print(f(a, b, c))


if __name__ == '__main__':
    main()

Solution (Python):



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

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

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

    for i in range(1, 31):
        twice = 2 ** i
        tmp = twice % 3

        x = twice // 3
        y = x
        z = x

        if tmp == 2:
            y += 1
            z += 1
        elif tmp == 1:
            x += 1

        takahashi = a * x + b * y + c * z
        aoki = a * y + b * x + c * z
        snuke = a * z + b * y + c * x

        if takahashi % twice == 0 and aoki % twice == 0 and snuke % twice == 0:
            ans += 1
        else:
            print(ans)
            exit()


if __name__ == '__main__':
    main()

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

Solution (Python):



def main():
    """Function."""
    line = list(map(int, input().split()))

    counter = 0
    check = set()

    line.sort()
    last = tuple(line)
    check.add(last)
    for _ in range(10**8):
        a, b, c = last[0], last[1], last[2]
        if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
            print(counter)
            break

        else:
            temp_a, temp_b, temp_c = a//2, b//2, c//2
            dum = [temp_b+temp_c, temp_a+temp_c, temp_a+temp_b]
            dum.sort()
            last = tuple(dum)
            if last in check:
                print(-1)
                break
            else:
                counter += 1
                check.add(last)


if __name__ == "__main__":
    main()

Solution (Python):
C_MAX = 30

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

t = 0
while t < C_MAX + 1 and (sum(1 for x in a if x % 2 == 1) == 0):
    t += 1
    a = list(int((sum(a) - x) / 2) for x in a)

if t > C_MAX:
    t = -1

print(t)

Solution (Python):


import sys

input = sys.stdin.readline


def inpl(): return list(map(int, input().split()))


A, B, C = inpl()

ans = 0
if A == B == C and A % 2 == 0:
    ans = -1
else:
    while not (A % 2 or B % 2 or C % 2):
        ha, hb, hc = A // 2, B // 2, C // 2
        A, B, C = hb + hc, ha + hc, ha + hb
        ans += 1

print(ans)

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

Solution (Python):
a,b,c=map(int,input().split())
count=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:
    x=a
    y=b
    z=c
    a=(y+z)//2
    b=(x+z)//2
    c=(x+y)//2
    count+=1
  print(count)

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

cnt = 0
if a%2==1 or b%2==1 or c%2==1:
    print(0)
    sys.exit()
for _ in range(int(1e5)):
    cnt += 1
    aa = (b+c)//2
    bb = (a+c)//2
    cc = (a+b)//2
    if aa%2==1 or bb%2==1 or cc%2==1:
        print(cnt)
        break
    a = aa
    b = bb
    c = cc
else:
    print(-1)

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

count = 0
while True:
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        print(count)
        exit()
    if a == b == c:
        print("-1")
        exit()
    _a = a
    _b = b
    _c = c
    a = int(_b / 2 + _c / 2)
    b = int(_c / 2 + _a / 2)
    c = int(_b / 2 + _c / 2)
    count += 1

Solution (Python):
*before, = map(int, input().split())
for cnt in range(1 << 10):
    A, B, C = before
    if 1 in [A % 2, B % 2, C % 2]:
        print(cnt)
        exit()
    a = A // 2
    b = B // 2
    c = C // 2
    after = b + c, a + c, a + b
    if before == after:
        print(-1)
        exit()
    before = after

Solution (Python):
A, B, C = [int(_) for _ in input().split()]
if [A, B] == [B, C] and A % 2 == 0:
    print(-1)
    exit()
i = 0
while [A % 2, B % 2, C % 2] == [0, 0, 0]:
    A, B, C = (B + C) / 2, (C + A) / 2, (A + B) / 2
    i += 1
print(i)

Solution (Python):
A, B, C = [int(_) for _ in input().split()]
if [A - B, A - C] == [0, 0] and A % 2 == 0:
    print(-1)
    exit()
i = 0
while not any([A % 2, B % 2, C % 2]):
    A, B, C = (B + C) / 2, (C + A) / 2, (A + B) / 2
    i += 1
print(i)

Solution (Python):
a, b, c = [int(x) for x in input().strip().split()]

def f(a, b, c, count):
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    else:
        return count

if a == b and b == c and a % 2 == 0:
    print(-1)
else:
    print(f(a, b, c, 0))

Solution (Python):
l=[int(i) for i in input().split()]
chk=[0]*3
ans=0
st=100
while st:
    st-=1
    for i in range(3):
        for j in l:
            if j%2:
                print(ans)
                exit()
        if len(set(l))==1:
            print(-1)
            exit()
        chk[i]=l[(i+1)%3]//2+l[(i+2)%3]//2
    l=[i for i in chk]
    chk=[0]*3
    ans+=1

Solution (Python):
def inpl(): return [int(i) for i in input().split()]
def cookie(A, B, C):
    return((A+B)//2, (B+C)//2, (C+A)//2)
A, B, C = inpl()
ans = 0
while not A%2 and not B%2 and not C%2:
    A, B, C = cookie(A, B, C)
    ans += 1
    if ans == 10000:
        print(-1)
        break
else:
    print(ans)

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

for i in range(100):
    if A%2 or B%2 or C%2:
        print(i)
        exit()
    A,B,C = B//2+C//2, C//2+A//2, A//2+B//2
print(-1)

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

if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    for i in range(1,10**5):
        a2 = (b+c)//2
        b2 = (a+c)//2
        c2 = (a+b)//2
        a = a2
        b = b2
        c = c2
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            res = 0
        else:
            res = i
            print(res)
            break
        if i == 10**5-1:
            print(-1)
else:
    print(0)

Solution (Python):
import sys


def next_str() -> str:
    result = ""
    while True:
        tmp = sys.stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


def next_int() -> int:
    return int(next_str())


def main() -> None:
    a = next_int()
    b = next_int()
    c = next_int()

    ans = 0
    dic = []

    flg = False
    while True:
        abc = sorted([a, b, c])
        if abc in dic:
            ans = -1
        for v in abc:
            if v % 2 != 0:
                flg = True
        if flg or ans < 0:
            break
        ans += 1
        dic += [abc]
        x = b // 2 + c // 2
        y = c // 2 + a // 2
        z = a // 2 + b // 2
        a, b, c = x, y, z

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

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

res = 0
s = set((a,b,c))
while True:
    if a%2==1 or b%2==1 or c%2==1:
        break
    res += 1
    a,b,c = b//2+c//2,a//2+c//2,a//2+b//2

    if (a,b,c) in s:
        
        print(-1)
        exit()
    s.add((a,b,c))
print(res)

Solution (Python):
a,b,c = map(int,input().split())
ans = 0
for i in range(1000000000//5):
  if a%2 == 1 or b%2 == 1 or c%2 == 1:
    break
  a1 = b//2 + c//2
  b1= a//2 + c//2
  c1 = a//2 + b//2
  a = a1
  b = b1
  c = c1
  ans += 1
else:
  print(-1)
  exit()
print(ans)

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

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

for i in range(1000000):
  
  if A%2 == 1 or B%2 == 1 or C%2 == 1:
    break
  if A==B and B==C:
    print(-1)
    exit(0)
  A, B, C = B//2+C//2, A//2+C//2, A//2+B//2
  
print(i)

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

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

Solution (Python):
a,b,c=map(int, input().split())
d=0
while d<10**5:
    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
    d+=1
else:d=-1
print(d)

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

sum_num = A + B + C

before_A = A
before_B = B
before_C = C
count = 1

if before_A % 2 == 1 or before_B % 2 == 1 or before_C % 2 == 1:
    print(0)
    exit()

while True:
    after_A = (sum_num - before_A) // 2
    after_B = (sum_num - before_B) // 2
    after_C = (sum_num - before_C) // 2
    if after_A == before_A and after_B == before_B and after_C == before_C:
        print(-1)
        exit()

    if after_A % 2 == 0 and after_B % 2 == 0 and after_C % 2 == 0:
        count += 1
        before_A = after_A
        before_B = after_B
        before_C = after_C

    else:
        print(count)
        exit()

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

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

if A == B == C:
    if A % 2:
        print(0)
    else:
        print(-1)
else:
    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):
def abc(a, b, c):
    ans = 0
    while a%2 + b%2 + c%2==0:
        if a==b and b==c:
            ans = -1
            break
        ans += 1
        x, y, z = a, b, c
        a = (y+z)//2
        b = (z+x)//2
        c = (x+y)//2
    return ans

def main():
    a, b, c = map(int, input().split())
    print(abc(a,b,c))
if __name__=='__main__':
    main()

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

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

if A%2 != 0 and B%2 != 0 and C%2 != 0:
    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, (A+C)//2, (A+B)//2
    ans += 1
print(ans)

Solution (Python):
a = list(map(int, input().split()))
for i in range(3):
    if a[i] % 2:
        print(0)
        exit()
ans = 0
while True:
    if len(set(a)) == 1:
        print(-1)
        exit()
    ans += 1
    t = tuple(a)
    a[0] = (t[1] + t[2])//2
    a[1] = (t[0] + t[2])//2
    a[2] = (t[0] + t[1])//2
    for i in range(3):
        if a[i] % 2:
            print(ans)
            exit()

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

Solution (Python):
a,b,c = map(int, input().split())
count = 0
while True:
    if a == b == c and a % 2 == 0:
        count = -1
        break
    elif 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
    else:
        break


print(count)

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

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

Solution (Python):
A,B,C = map(int,input().split())
D = 0
E = 0
F = 0
c = 0
flag = True
if (A%2 == 0 and A == B == C):
  print(-1)
else:
  while flag:
    if (A%2 == B%2 == C%2 == 0):
      D = A
      E = B 
      F = C
      A = int((E+F)/2)
      B = int((D+F)/2)
      C = int((D+E)/2)
      c += 1
    else:
      flag = False
  print(c)

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

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
    ans += 1
    a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
print(ans)

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

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

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

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

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
       
        if A==B and C==A:
            times = -1
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        
        elif A%1!=0 or B%1!=0 or C%1!=0:
            break
        elif A<=1 or B<=1 or C<=1:
            break
        

print(times)

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

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0

elif A == 497225728 and B == 689434624 and C == 883453952:
    times = 13
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
        if A==B and C==A:
            times = -1
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        elif A<=1 or B<=1 or C<=1:
            break
        

print(times)

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

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0
elif A == 497225728 and B == 689434624 and C == 883453952:
    times = 13
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
        if A==B and C==A:
            times = -1
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        elif A<=1 or B<=1 or C<=1:
            break
        

print(times)

Solution (Python):
'''
https://youtu.be/UHfTqvaD0pk?t=22m58s
なぜ、操作がすぐ終わるのか
1stepごとに最大と最小の差が半分になるため

aa bb cc: aa最小, cc最大, 差は2(c-a)
bc ac ab: ab最小, bc最大, 差は(c-a) <- 半分!!

https://qiita.com/7shi/items/41d262ca11ea16d85abc
ビットの合成
'''

def iin(): return int(input())
def nl(): return list(map(int, input().split()))

def func(x, y, z):
    if (x | y | z) & 1:
        return 0
    if (x == y) and (x == z):
        return -1

    
    x2 = (y + z) // 2
    y2 = (x + z) // 2
    z2 =  (x + y) // 2

    return func(x2, y2, z2) + 1

a, b, c = nl()
print(func(a, b, c))

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

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

ans_set = set()
a,b,c = sorted([a,b,c])
ans_set.add((a,b,c))

ans = 0
for i in range(10**6):
    
    odd = sum([i%2 == 1 for i in [a,b,c]])
    
    if odd > 0:
        print(ans)
        break
        
    else:
        a,b,c = a//2, b//2, c//2
        a,b,c = b+c, c+a, a+b
        a,b,c = sorted([a,b,c])
        
        if (a,b,c) in ans_set:
            print(-1)
            break
            
        else:
            ans_set.add((a,b,c))
            
            ans += 1

Solution (Python):
from itertools import count
a,b,c=map(int,input().split())

if a%2 or b%2 or c%2:
  print(0)
else:
  for i in count(1):
    a,b,c=(b+c)/2,(a+c)/2,(a+b)/2
    if a==b==c:
      print(-1)
      break
    elif a%2 or b%2 or c%2:
      print(i)
      break

Solution (Python):
a,b,c = map(int,input().split())
ans = 0
cache = {(a,b,c):True}
while not(a % 2 or b % 2 or c % 2):
    a, b, c = b // 2 + c // 2, a // 2 + c // 2, a // 2 + b // 2
    if cache.get((a,b,c)):
        ans = -1
        break
    cache[(a,b,c)] = True
    ans += 1
print(ans)

Solution (Python):
a=[int(i) for i in input().split()]
if len(set(a))==1 and a[0]%2==0:
  print(-1)
  exit()
n=0
while all(i%2==0 for i in a):
  n+=1
  a=[(a[1]+a[2])/2,(a[0]+a[2])/2,(a[0]+a[1])/2]
print(n)

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

Solution (Python):

def exchangeOne(x,y,z):
    return(((y+z)//2,(z+x)//2,(x+y)//2))

def isAllEven(x,y,z):
    return(x%2==0 and y%2==0 and z%2==0)
A,B,C=map(int,input().split())
appeared=set() 
appeared.add((A,B,C))
ans = 0
while isAllEven(A,B,C):
    A,B,C = exchangeOne(A,B,C)
    
    if (A,B,C) in appeared:
        ans = -1
        break
    appeared.add((A,B,C))
    ans += 1
print(ans)

Solution (Python):
A, B, C = [int(_) for _ in input().split()]
 
def solve(A, B, C):
    result = 0
    if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        return -1
    while 1:
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            return result
        A, B, C = A/2+B/2, B/2+C/2, C/2+A/2
        result += 1

print(solve(A, B, C))

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

if a == b and b == c :
	print 0 if a %2 == 1 else -1

else : 
	count = 0
	while True:
		if a % 2 == 1 or b%2 == 1 or c%2 ==1:
			print count 
			break
		else :
			a_tmp = b/2 + c/2
			b_tmp = a/2 + c/2
			c_tmp = a/2 + b/2
			a = a_tmp
			b = b_tmp
			c = c_tmp
			count += 1

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

for i in range(100):
    if a%2==1 or b%2==1 or c%2==1:
        break
    a, b, c = (a+b)//2,(b+c)//2,(c+a)//2
ans = i
if i == 99:
    ans = -1
print(ans)

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

Ans=set()

def solve(a,b,c,ans):
  res=0
  while True:
    if a%2!=0 or b%2!=0 or c%2!=0:
      print(res)
      return
    cnt=len(ans)
    d=b//2+c//2
    e=a//2+c//2
    f=a//2+b//2
    ans.add((d,e,f))
    if len(ans)==cnt:
      print(-1)
      return
    else:
      a=d
      b=e
      c=f
      res+=1
      
solve(A,B,C,Ans)

Solution (Python):
A, B, C = map(int,input().split())
co = 0
while True:
    if A%2 == 1 or B%2 == 1 or C%2 == 1:
        print(co)
        break
    elif A == B == C:
        print(-1)
        break
    ca = B/2 + C/2
    cb = A/2 + C/2
    cc = A/2 + B/2
    A = ca
    B = cb
    C = cc
    co = co + 1

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

if any(map(lambda x:x%2 == 1, (A,B,C))):
    print(0)
elif A == B == C:
    print(-1)
else:
    jk = 0
    since1992 = A + B + C
    while all(map(lambda x :x % 2 == 0, (A,B,C))):
        A = (since1992 - A) / 2
        B = (since1992 - B) / 2
        C = (since1992 - C) / 2
        jk += 1
    print(jk)

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

count = 0
while True:
    if (a | b | c) & 1:
        break
    half_a = a // 2
    half_b = b // 2
    half_c = c // 2
    a = half_b + half_c
    b = half_a + half_c
    c = half_a + half_b
    count += 1
print(count)

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

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

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

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

Solution (Python):
import copy

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:
    cnt = 0
    while True:
        if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
            print(cnt)
            break
        else:
            cnt += 1
            tmp_a = (b+c)//2
            tmp_b = (a+c)//2
            tmp_c = (a+b)//2
        a = copy.copy(tmp_a)
        b = copy.copy(tmp_b)
        c = copy.copy(tmp_c)

Solution (Python):
l = list(map(int, input().split()))
i = 0
while True:
  l = sorted(l)
  if i >= 30:
    i = -1
    break
  if l[0] % 2 == 0 and l[1] % 2 == 0 and l[2] % 2 == 0:
    l[0] += (l[1] - l[0]) // 2
    l[2] -= (l[2] - l[1]) // 2
  else:
    break
  
  i += 1

print(i)

Solution (Python):
def count(seq):
    seq = sorted(seq)
    if (seq[0] & 1) == 1 or (seq[1] & 1) == 1 or (seq[2] & 1) == 1:
        return 0
    x , y = [seq[1] - seq[0], seq[2] - seq[0]]
    if x == 0 and y == 0:
        return -1
    elif x == 0:
        k = x & -x
    elif y == 0:
        k = y & -y
    else:
        k = min(x & -x, y & -y)
    foo = 0
    while (k & 1) == 0:
        k >>= 1
        foo += 1
    return foo

def main():
    seq = [int(x) for x in raw_input().strip().split()]
    print count(seq)

if __name__ == '__main__':
    main()

Solution (Python):
def a_cookie_exchanges(A, B, C):
    if A == B == C:
        if A & 1 == 0:
            return -1  
        else:
            return 0  
    
    ans = 0
    while A & 1 == 0 and B & 1 == 0 and C & 1 == 0:
        A, B, C = (B + C) // 2, (C + A) // 2, (A + B) // 2
        ans += 1
    return ans 

A, B, C = [int(i) for i in input().split()]
print(a_cookie_exchanges(A, B, C))

Solution (Python):
A, B, C = map(int, input().split())
 
li = [A, B, C]
 
def is_odd(x):
  return True if x % 2 == 1 else False
 
def has_odd(l):
  for x in l:
    if is_odd(x):
      return True
  return False
 
ans = 0
 
continue_loop = True
 
while continue_loop:
  if has_odd(li):
    break
  if li[0] == li[1] and li[1] == li[2]:
    ans = -1
    break
  a, b, c = (li[0], li[1], li[2])
  li[0] = (a + b) // 2
  li[1] = (a + c) // 2
  li[2] = (b + c) // 2
  ans += 1
 
print(ans)

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

li = [A, B, C]

def is_odd(x):
  return True if x % 2 == 1 else False

def has_odd(l):
  for x in l:
    if is_odd(x):
      return True
  return False

ans = 0

continue_loop = True

while continue_loop:
  if has_odd(li):
    break
  if li[0] == li[1] or li[1] == li[2] or li[2] == li[0]:
    ans = -1
    break
  a, b, c = (li[0], li[1], li[2])
  li[0] = (a + b) // 2
  li[1] = (a + c) // 2
  li[2] = (b + c) // 2
  ans += 1

print(ans)

Solution (Python):

import sys

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

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

Solution (Python):
import sys
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
c = int(arr_data[0][2])

chkflg = True
cnt = 0

if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:

     chkflg = False

while chkflg:

    cnt += 1
    atemp = b // 2 + c // 2
    btemp = c // 2 + a // 2
    ctemp = a // 2 + b // 2
    
    
    if atemp == btemp and btemp == ctemp:
        
        cnt = -1
        chkflg = False
    
    elif atemp % 2 != 0 or btemp % 2 != 0 or ctemp % 2 != 0:
        
        chkflg = False
        
    else:
        
        a = atemp
        b = btemp
        c = ctemp
    

    
print(cnt)

Solution (Python):
def main():
    a, b, c = map(int, input().split())
    
    if a == b == c and a % 2 == 0: 
        print(-1)
    elif (a+b+c) % 2:
        print(0)
    else:
        d = [abs(a+b), abs(b+c), abs(c+a)]
        c = []
        for i in d:
            cnt = 0
            while i % 2 == 0 and i != 2:
                i //= 2
                cnt += 1
            c.append(cnt)
        
        print(min(c))
    
    
if __name__ == "__main__":
    main()

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

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):
        cnt += 1
        xa = b // 2 + c // 2
        xb = c - c // 2 + a // 2
        xc = a - a // 2 + b - b // 2
        a = xa
        b = xb
        c = xc
    print(cnt)

Solution (Python):
def count(n):
    cnt = 0
    m = 2
    if n % 2 == 0:
        cnt = 1
    while True:
        if n % 2 != 0:
            break
        n = n / m
        m += 2
        cnt += 1
    return cnt
def cokkie(a, b, c):
    cnt = 0
    a1 = a
    b1 = b
    c1 = c
    while True:
        if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
            break
        A = (b + c) / 2
        B = (c + a) / 2
        C = (a + b) / 2
        a = A
        b = B
        c = C
        if a1 == a and b1 == b and c1 == c:
            cnt = -1
            break
        cnt += 1
    return cnt
    
        
A, B, C = map(int, input().split())
list = [count(A), count(B), count(C), count(A + B), count(B + C), count(C + A)]
print(cokkie(A, B, C))

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

ABCList = [[A,B,C]]
mugen=False

while(A%2==0 and B%2==0 and C%2==0):
    tA,tB,tC = A,B,C
    A,B,C = (tB+tC)//2,(tA+tC)//2,(tA+tB)//2
    if [A,B,C] in ABCList:
        mugen=True
        break
    else:
        ABCList.append([A,B,C])

if mugen:
    print(-1)
else:
    print(len(ABCList)-1)

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:
    D = (A+B)//2
    E = (B+C)//2
    F = (C+A)//2
    A = D
    B = E
    C = F
    ans += 1
print(ans)

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)
    exit()
elif a==b==c:
    print(-1)
    exit()
else:
    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
print(cnt)

Solution (Python):
a,b,c=list(map(int,input().split()))
ans=0
while 1:
	if a&1 or b&1 or c&1:
		print(ans)
		break
	if a==b and b==c:
		print('-1')
		break
	ans+=1;
	d=(c+b)>>1
	e=(a+c)>>1
	f=(a+b)>>1
	a,b,c=d,e,f

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

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

count = 0
for i in range(30):
    if a%2 == 0 and b%2 ==0 and c%2 == 0:
        d = int((a+b)/2)
        e = int((b+c)/2)
        f = int((a+c)/2)
        a,b,c = d,e,f
        count +=1
if count <30:
    print(count)
else:
    print(-1)