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:
  if a%2 == 0:
    print(-1)
  else:
    print(0)
else:
  ans = 0
  while a % 2 == 0 and b % 2 == 0 and c % 2 ==0:
    a1 = a
    b1 = b
    c1 = c
    a = (b1+c1)/2
    b = (a1+c1)/2
    c = (a1+b1)/2
    ans += 1
  print(ans)

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

Solution (Python):

import re
import math
from collections import defaultdict
from collections import deque
import itertools
from copy import deepcopy
import random
import time
import os
import queue
import sys
import datetime
from functools import lru_cache

readline=sys.stdin.readline
sys.setrecursionlimit(2000000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_pow(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def get_primes(n,type="int"):
    if n==0:
        if type=="int":return []
        else:return [False]
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
    return ret
def seifu(x):
    return x//abs(x)

def main():
    a,b,c=map(int,input().split())
    cnt=0
    while not(a==b and b==c) and 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
    if a==b and b==c and a%2==0 and b%2==0 and c%2==0:
        print(-1)
    else:
        print(cnt)
main()

Solution (Python):
A,B,C = [int(hoge) for hoge in input().split()]
cnt = 0
while not (A%2 or B%2 or C%2):
    NewA = B//2 + C//2
    NewB = A//2 + C//2
    NewC = A//2 + B//2
    A,B,C = NewA,NewB,NewC
    cnt += 1
    if A==B==C:
        print(-1);exit()
print(cnt)

Solution (Python):
import sys
from collections import defaultdict

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

cnt = 0
memo = defaultdict(int)

while (A % 2 != 1) & (C % 2 != 1) & (C % 2 != 1):
    if memo[(A, B, C)]==1:
        print(-1)
        sys.exit()
    tmp_a = A // 2
    tmp_b = B // 2
    tmp_c = C // 2
    memo[(A, B, C)] = 1
    A = tmp_b + tmp_c
    B = tmp_c + tmp_a
    C = tmp_a + tmp_b
    cnt += 1

print(cnt)

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

if a==b==c and(a%2==0 and b%2==0 and c%2==0):
    print(-1)
else:      
    while True:
        a1=a//2
        b1=b//2
        c1=c//2
        if (a%2==0 and b%2==0 and c%2==0):
            count+=1
            a=b1+c1
            b=a1+c1
            c=a1+b1
        else:
            print(count)
            break

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

Solution (Python):
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0

def che(a,b,c):
    if a%2:
        return 1
    elif b%2:
        return 1
    elif c%2:
        return 1
    else:
        return 0

a,b,c = map(int,input().split())
if(che(a,b,c)):
    print(0)
elif ((a == b)and(a == c)):
    print(-1)
else:
    while True:
        neko = neko + 1
        nya = a / 2
        nuko = b / 2
        a = c/2 + nuko
        b = c/2 + nya
        c = nuko + nya

        if a%2:
            break
        if b%2:
            break
        if c%2:
            break
    print(neko)

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

Solution (Python):
A,B,C=list(map(int,input().split()))
if A == B == C:
    if A%2==1 or B%2==1 or C%2==1:
        print(0)
        exit()
    else:
        print(-1)
        exit()
for i in range(10**9):
    if A%2==1 or B%2==1 or C%2==1:
        print(i)
        exit()
    A,B,C=(B+C)//2,(A+C)//2,(A+B)//2

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))




def resolve():
    A=list(pin())
    ans=0
    for i in range(10**6):
        
        B=[0]*3
        for a in range(3):
            if A[a]%2!=0:print(ans);return
        B[0]=(A[1]+A[2])//2
        B[1]=(A[0]+A[2])//2
        B[2]=(A[0]+A[1])//2
        A=B[:]
        ans+=1
    print(-1)
    
                
    

resolve()

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def SS(): return map(str,sys.stdin.readline().rstrip().split())
def II(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C = II()


if A==B==C and A % 2 != 1:
  print(-1)
  exit()
cnt = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
  A_half = A/2
  B_half = B/2
  C_half = C/2
  A = B_half + C_half
  B = A_half + C_half
  C = A_half + B_half
  cnt += 1
print(cnt)

Solution (Python):
A, B, C = map(int, input().split())
x, y = abs(A-B), abs(B-C)
ans = 0
if x == 0 and y == 0 and A % 2 == 0:
  print(-1)
  exit()

if x == 0 and y == 0 and A % 2 == 1:
  print(0)
  exit()
  
while x % 2 == 0 and y % 2 == 0:
  x, y = x // 2, y // 2
  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 and c == a:
        count = -1
        break
    a_tmp = a
    b_tmp = b
    c_tmp = c
    a = (b_tmp + c_tmp) / 2
    b = (c_tmp + a_tmp) / 2
    c = (a_tmp + b_tmp) / 2
    count += 1
print(count)

Solution (Python):
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())
cnt = 0
while True:
  if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
    break
  if a == b == c:
    cnt = -1
    break
  k, l, m = a//2, b//2, c//2
  a = l + m
  b = k + m
  c = k + l
  cnt += 1
print(cnt)

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

test = [[a,b,c]]
count = 0
while a%2 == b%2 == c%2 == 0:
    at = a
    bt = b
    ct = c
    a = bt//2 + ct//2
    b = ct//2 + at//2
    c = at//2 + bt//2
    count+=1
    if [a,b,c] in test:
        count = -1
        print(count)
        break
    else:
        test.append([a,b,c])
if count != -1:
    print(count)

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

Solution (Python):
a=list(map(int,input().split()))
a1=a.copy()
count=0
if a[0]%2==1 or a[1]%2==1 or a[2]%2==1:
    print(count)
elif a[0]==a[1]==a[2]:
    print(-1)
else:
    while True:
        a[0]=(a1[1]+a1[2])//2
        a[1]=(a1[0]+a1[2])//2
        a[2]=(a1[0]+a1[1])//2
        a1=a.copy()
        count+=1
        if a[0]%2==1 or a[1]%2==1 or a[2]%2==1:
            print(count)
            exit()

Solution (Python):
def main():
    A,B,C=map(int,input().split())
    ans=0
    tmp=set()
    while A%2==0 and B%2==0 and C%2==0:
        A,B,C=(B+C)//2,(C+A)//2,(A+B)//2
        if (A,B,C) in tmp:
            print(-1)
            exit()
        else:
            tmp.add((A,B,C))
        ans += 1
    print(ans)

main()

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

Solution (Python):
def main():
    A, B, C = map(int, input().split())
    cnt = 0; flag = False
    for _ in range(pow(10,6)):
        if A%2 == 1 or B%2 == 1 or C%2 == 1:
            flag = True
            break
        A, B, C = B//2+C//2, A//2+C//2, A//2+B//2
        cnt += 1
    ans = flag*cnt + (not flag)*(-1)
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    ans = 0
    a, b, c = map(int, input().split())
    while a%2 == b%2 == c%2 == 0:
        ans += 1
        a, b, c = (b//2 + c//2), (a//2 + c//2), (a//2 + b//2)
        if a == b == c:
            ans = -1
            break

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    ans = 0
    a, b, c = map(int, input().split())
    while a%2 == b%2 == c%2 == 0:
        ans += 1
        ta = a//2
        tb = b//2
        tc = c//2
        a = tb + tc
        b = ta + tc
        c = ta + tb
        if a == b == c:
            ans = -1
            break
    print(ans)

if __name__ == '__main__':
    main()

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

x=0
if A==B and A==C:
    if A%2==0 and B%2==0 and C%2==0:
        print(-1)
    else:
        print(0)
else:
    while x>=0:
        if A%2==0 and B%2==0 and C%2==0:
            x+=1
            tmp1=A
            tmp2=B
            tmp3=C
            A=(tmp2+tmp3)//2
            B=(tmp1+tmp3)//2
            C=(tmp1+tmp2)//2
            
        else:
            break
    print(x)

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 True:
    count += 1
    a,b,c = b//2+c//2,a//2+c//2,a//2+b//2
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        break

print(count)

Solution (Python):
a,b,c = tuple(map(int,input().split()))
if len(set((a,b,c)))==1 and a%2==1:
    print(0)
    exit()
ans = 0
while True:
  if len(set((a,b,c)))==1:
    print(-1)
    exit()
  if 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
    ans+=1
  else:
    break
print(ans)

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

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

cnt=0
while(A%2==B%2==C%2==0):
  _A=A;_B=B;_C=C
  A=_B//2+_C//2
  B=_A//2+_C//2
  C=_B//2+_A//2
  cnt+=1
  
print(cnt)

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

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

OK = True
count = 0

while OK:
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        OK = False
        break
    diva = a / 2
    divb = b / 2
    divc = c / 2
    a = divb + divc
    b = divc + diva
    c = diva + divb
    count += 1

print(count)

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

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

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

A, B, C = LI()

ans = 0
while 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)
    ans += 1
    if ans == 10000:
        break


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

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

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


if A == B == C and A % 2 == 0:
    print('-1')
else:
    count=0
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        A_copy, B_copy, C_copy = A, B, C
        A = int(B_copy/2 + C_copy/2)
        B = int(A_copy/2 + C_copy/2)
        C = int(A_copy/2 + B_copy/2)
        count += 1
    print(count)

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

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

OK = True
count = 0

while OK:
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        OK = False
        break
    diva = a//2
    divb = b//2
    divc = c//2
    a = divb + divc
    b = divc + diva
    c = diva + divb
    count += 1

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:
        print(-1)
        exit()
    count += 1
    A1 = A
    B1 = B
    C1 = C
    A = B1//2 + C1//2
    B = A1//2 + C1//2
    C = A1//2 + B1//2

print(count)

Solution (Python):
A,B,C=map(int, raw_input().split())
cnt=0

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

for _ in range(100):
    cnt+=1
    new_A=B/2+C/2
    new_B=A/2+C/2
    new_C=A/2+B/2
    A,B,C=new_A,new_B,new_C
    if new_A%2==1 or new_B%2==1 or new_C%2==1:
        print cnt
        quit()
else:
    print -1

Solution (Python):
def resolve():
    a, b, c = map(int, input().split())
    count = 0
    while True:
        if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
            break
        _a = b / 2 + c / 2
        _b = a / 2 + c / 2
        _c = a / 2 + b / 2

        if [a, b, c] == [_a, _b, _c]:
            count = -1
            break
        else:
            a, b, c = _a, _b, _c
            count += 1

    print(count)


resolve()

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


def is_even(a, b, c):
	cookies = [a, b, c]
	return all(c % 2 == 0 for c in cookies)


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

for i in range(1000):
	if is_even(a, b, c):
		new_a = b//2 + c//2
		new_b = a//2 + c//2
		new_c = a//2 + b//2
		a, b, c = new_a, new_b, new_c
	else:
		print(i)
		exit()

print(-1)

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

if len(set(c)) == 1 and c[0] % 2 == 0:
    print(-1)
    exit()

cnt = 0
while c[0] % 2 != 1 and c[1] % 2 != 1 and c[2] % 2 != 1:
    c = [c[1]/2 + c[2]/2, c[0]/2 + c[2]/2, c[0]/2 + c[1]/2]
    cnt += 1
print(cnt)

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

cnt = 0
if (a == b) and (b == c) and (a%2==0):
    print(-1)
elif (a%2!=0) or b%2!=0 or c%2!=0:
    print(0)
else:
    while(True):
        a_ = a/2
        b_ = b/2
        c_ = c/2
        a = b_ + c_
        b = a_ + c_
        c = a_ + b_
        cnt+=1
        if a%2!=0 or b%2!=0 or c%2!=0:
            print(cnt)
            exit()

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

cnt=0
a = A
b = B
c = C

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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

if A == B and 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
    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
    ans += 1

print(ans)

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

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 and a%2==0:
    print(-1)
    exit()

sabc = a+b+c

cnt = 0
while True:
    a = (sabc-a)/2
    b = (sabc-b)/2
    c = (sabc-c)/2
    cnt+=1
    if a%2==1 or b%2==1 or c%2==1: break

print(cnt)

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

a1 = (b + c) / 2
b1 = (a + c) / 2
c1 = (a + b) / 2

diffs = [abs(a-a1), abs(b-b1), abs(c-c1)]

ans = []
for tmpdiff in diffs:
  count = 1
  while tmpdiff % 2 == 0:
    tmpdiff = tmpdiff / 2
    count += 1
    if tmpdiff == 0:
      count = -1
      break
      
  ans.append(count)

if not (a%2 ==0 and b%2 ==0 and c%2 ==0):
  print(0)
elif ans == [-1 for _ in range(len(ans))]:
  print(-1)
else:
  print(min([i for i in ans if i >0]))

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

ans = 0

while (A%2 == 0) & (B%2 == 0) & (C%2 == 0):
    if (A==B) & (B==C) :
        ans = -1
        break

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

print(ans)

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

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

while flag == True:
  if a%2 == 0 and b%2 == 0 and c%2 == 0:
    if (a==b==c):
      ans = -1
      break
    
    ans += 1
    at=a
    bt=b
    ct=c
    a = int(bt/2+ct/2)
    b = int(at/2+ct/2)
    c = int(at/2+bt/2)
  else:
    flag = False
    break
  
print(ans)

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

Solution (Python):


def main():
    A, B, C = map(int, open(0).read().split())

    if A == B == C and A % 2 == 0:
        print(-1)
    elif A % 2 or B % 2 or C % 2 == 1:
        print(0)
    else:
        cnt = 0
        for i in range(0, max(A, B, C)):
            if A % 2 or B % 2 or C % 2 == 1:
                break
            else:
                tmpA = B//2 + C//2
                tmpB = A//2 + C//2
                tmpC = A//2 + B//2
                A = tmpA
                B = tmpB
                C = tmpC
                cnt += 1
        print(cnt)


main()

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

ans=0
while a%2==0 and b%2==0 and c%2==0:
  if a==b==c:
    print(-1)
    exit(0)
  aa=a/2
  bb=b/2
  cc=c/2
  a=bb+cc
  b=aa+cc
  c=bb+aa
  ans+=1
print(ans)

Solution (Python):
A, B, C = [int(i) for i in input().split()]
t, a, s = [A, B, C]
ans = 0


while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    if A == B == C:
        ans = -1
        break
    t = B / 2 + C / 2
    a = A / 2 + C / 2
    s = A / 2 + B / 2
    A = t
    B = a
    C = s
    ans += 1

print(ans)

Solution (Python):
A,B,C=[int(i) for i in input().split(" ")]
memo={}
n=0
while A%2==0 and B%2==0 and C%2==0:
    A,B,C=B/2+C/2,A/2+C/2,A/2+B/2
    n+=1
    if (A,B,C) in memo:
        print(-1)
        break
    else:
        memo[(A,B,C)]=1
        memo[(A,C,B)]=1
        memo[(B,A,C)]=1
        memo[(B,C,A)]=1
        memo[(C,A,B)]=1
        memo[(C,B,A)]=1
else:
    print(n)

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 a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        next_a = b//2 + c//2
        next_b = a//2 + c//2
        next_c = a//2 + b//2
        a = next_a
        b = next_b
        c = next_c
        ans += 1
    print(ans)

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

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

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

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


def read():
    A, B, C = map(int, input().strip().split())
    return A, B, C


def solve(A, B, C):
    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        return 0
    if A == B and B == C:
        return -1
    n = 0
    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 = a
        B = b
        C = c
        n += 1
    return n


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))

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

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

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

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

print(res)

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:
        print(-1)
        exit()
    A1=A
    B1=B
    C1=C
    A = B1/2+C1/2
    B = A1/2+C1/2
    C = A1/2+B1/2
    ans +=1
print(ans)

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

ans = 0

while True:
    if a == b == c and a % 2 == 0:
        print(-1)
        break
    elif a == b == c and a % 2 != 0:
        print(ans)
        break
    elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        print(ans)
        break
    else:
        t_a = a // 2
        t_b = b // 2
        t_c = c // 2
        a = t_b + t_c
        b = t_a + t_c
        c = t_a + t_b
        ans += 1

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
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()
    for i in range(1001):
        if a&1 or b&1 or c&1: 
            print(i)
            exit()
        na = (b+c)//2
        nb = (c+a)//2
        nc = (a+b)//2
        a,b,c = na,nb,nc
    print('-1')
if __name__ == '__main__':
  main()

Solution (Python):
import re
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)
    exit()
flag=True
co=0
if A%2!=0 or B%2!=0 or C%2!=0:
    flag=False
while flag==True:
    co+=1

    a=B/2 + C/2
    b=A/2 + C/2
    c=B/2 + A/2
    if a%2!=0 or b%2!=0 or c%2!=0:
        flag=False
    A=a
    B=b
    C=c

print(co)

Solution (Python):
from fractions import gcd
def main():
    a, b, c = map( int, input().split())
    if a == b == c:
        if a%2 == 1:
            print("0")
        else:
            print("-1")
        return
    ans = 0
    bi = 2
    while a%bi == 0 and b%bi == 0 and c%bi == 0:
        a, b, c = a//2+b//2, b//2+c//2, c//2+a//2
        ans += 1
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left



def main():
    a, b, c = MII()
    if a == b == c:
        print(a%2-1)
        return None
    cnt = 0
    while a%2==0 and b%2==0 and c%2==0:
        a, b, c = (c+b)//2, (a+c)//2, (a+b)//2
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left



def main():
    a, b, c = MII()
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        print(0)
        return None
    
    if a == b == c:
        print(-1)
        return None
    cnt = 0
    while a%2==0 and b%2==0 and c%2==0:
        x = b//2 + c//2
        y = a//2 + c//2
        z = a//2 + b//2
        a, b, c = x, y, z
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

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

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

Solution (Python):

a, b, c = map(int, input().split())
o = 0
if a == b == c:print(a%2-1);exit() 
while 1-any([a%2, b%2, c%2]):
    a, b, c = (b+c)//2, (c+a)//2, (a+b)//2
    o += 1
print(o)

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)