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%2 != 0 or B%2 != 0 or C%2 != 0:
    print(0)
    exit()
if A*2 == B+C and B*2 == A+C and C*2 == A+B:
    print(-1)
    exit()
ans = 0
for i in range(10000):
    a = A//2
    b = B//2
    c = C//2
    if A%2 == 0 and B%2 == 0 and C%2 == 0:
        ans += 1
        A = b+c
        B = a+c
        C = a+b
    else:
        print(ans)
        exit()

Solution (Python):






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





A_ = A
B_ = B
C_ = C

ans = 0
while True:
    if A_%2 != 0 or B_%2 != 0 or C_%2 != 0:
        print(ans)
        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
        ans += 1

        if A_ == A and B_ == B and C_ == C:
            print(-1)
            break

Solution (Python):
*a,=map(int,input().split())
b=[bin(a[i+1]-a[i])[::-1].find('1')for i in (0,1)]
print((max(b)*(b[0]*b[1]<0) or min(b))*(1-sum(a)%2))

Solution (Python):
*a,=map(int,input().split())
b=[bin(a[i+1]-a[i])[::-1].find('1')for i in (0,1)]
print((max(b) if b[0]*b[1]<0 else min(b))*(1-sum(a)%2))

Solution (Python):
*a,=map(int,input().split())
b=[bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)]
print((max(b) if b[0]*b[1]<0 else min(b))*(1-sum(a)%2))

Solution (Python):

*a, = map(int,input().split())
if any(map(lambda x: bin(x)[-1]== "1", a)):
    print("0")
    exit()
a = [bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)]
print(max(a) if a[0]*a[1]<0 else min(a))

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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    

    
    

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

if __name__ == '__main__':
    main()

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

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

cnt = 0
if A%2==1 or B%2==1 or C%2==1:
    print(cnt)
elif A==B==C:
    print('-1')
else:
    flag = True
    while flag:
        A, B, C = (B+C)//2, (A+C)//2, (A+B)//2
        cnt += 1
        if A%2==0 and B%2==0 and C%2==0:    
            continue
        else:
            flag = False

    print(cnt)

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

def even(a):
	if a % 2 == 0:
		return True
	else:
		return False

cnt = 0

while even(A) and even(B) and even(C):
	if A == B and B == C:
		cnt = -1
		break
	else:
		tmp1, tmp2, tmp3 = A,B,C
		A = (tmp2+tmp3) // 2
		B = (tmp3+tmp1) // 2
		C = (tmp1+tmp2) // 2
		cnt += 1

print(cnt)

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

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

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

def IsOdd(a, b, c):
    if a % 2 == 1:
        return True
    if b % 2 == 1:
        return True
    if c % 2 == 1:
        return True
    return False

def Exchange(a, b, c):
    retA = 0
    retB = 0
    retC = 0
    retA = (b // 2) + (c // 2)
    retB = (a // 2) + (c // 2)
    retC = (a // 2) + (b // 2)
    return retA , retB , retC

cnt = 0
routedA = []
while True :
    if IsOdd(A, B, C):
        break
    if A in routedA:
        cnt = -1
        break
    routedA.append(A)
    cnt += 1
    ret = Exchange(A, B, C)
    A = ret[0]
    B = ret[1]
    C = ret[2]

print(cnt)

Solution (Python):
def ex(x):
    while x%2==0 and x>2:
        x/=2
    if x==2:
        return 0
    else:
        return 1
a,b,c = map(int, input().split())
count = 0
if not ex(a)==ex(b)==ex(c)==0:
    while a%2==0 and b%2==0 and c%2==0:
        temp_a = a
        temp_b = b
        temp_c = c
        a = temp_b/2 + temp_c/2
        b = temp_a/2 + temp_c/2
        c = temp_a/2 + temp_b/2
        count+=1
        if ex(a)==ex(b)==ex(c)==0 or a==b==c:
            count = -1
            break
    print(count)
else:
    print("-1")

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

A=[a]+[0]*10**5
B=[b]+[0]*10**5
C=[c]+[0]*10**5

i=0
while A[i]%2+B[i]%2+C[i]%2==0:
    i+=1
    A[i]=B[i-1]//2+C[i-1]//2
    B[i]=C[i-1]//2+A[i-1]//2
    C[i]=A[i-1]//2+B[i-1]//2
    if A[i]==B[i]==C[i]:
        i=-1
        break
print(i)

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)
    exit()

ans = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    a_tmp = b // 2 + c // 2
    b_tmp = a // 2 + c // 2
    c_tmp = a // 2 + b // 2
    a, b, c = a_tmp, b_tmp, c_tmp
    ans += 1

print(ans)

Solution (Python):
A, B, C = list(map(int, input().split()))
cookies = set()
cookies.add((A, B, C))

a = A
b = B
c = C

count = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    count += 1
    a = a // 2
    b = b // 2
    c = c // 2
    
    a2 = b + c
    b2 = a + c
    c2 = b + c
    if (a2, b2, c2) in cookies:
        count = -1
        break
    a = a2
    b = b2
    c = c2
    cookies.add((a, b, c))
print(count)

Solution (Python):
a = list(map(int, input().split()))
count = 0
while all(x % 2 == 0 for x in a) and count <= 100000:
	b = [(sum(a) - x) // 2 for x in a]
	a = b
	count += 1
print(count if count <= 100000 else -1)

Solution (Python):
A,B,C=map(int,input().split())
ans=0
d=[]
a=A
b=B
c=C

while 1:
  if a%2!=0 or b%2!=0 or c%2!=0:
    print(ans)
    exit()
  if [a,b,c] in d:
    print(-1)
    exit()
  d.append([a,b,c])
  a1 = b//2 + c//2
  b1 = a//2 + c//2
  c1 = a//2 + b//2
  a=a1
  b=b1
  c=c1
  ans+=1

Solution (Python):
def resolve():
    A, B, C = map(int, input().split())
    cnt = 0
    while True:
        if A%2 == 1 or B%2 == 1 or C%2 == 1:
            break
        elif A==B and B==C:
            cnt = -1
            break
        Atmp = A
        Btmp = B
        Ctmp = C
        A = (Btmp+Ctmp)/2
        B = (Atmp+Ctmp)/2
        C = (Atmp+Btmp)/2
        cnt += 1
    print(cnt)
resolve()

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

ans = 0
while(1):
  tmp_A,tmp_B,tmp_C = A,B,C
  if((tmp_A%2 == 1)or(tmp_B%2 == 1)or(tmp_C%2 == 1)):
    break   
  A,B,C = (tmp_B+tmp_C)//2, (tmp_C+tmp_A)//2, (tmp_A+tmp_B)//2
  if((tmp_A == A)and(tmp_B == B)and(tmp_C == C)):
    ans = -1
    break
  ans += 1

print(ans)

Solution (Python):
def isOdd(n):
    return n % 2 == 1


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


def mi():
    return map(int, input().split())


def ii():
    return int(input())


A, B, C = li()

cnt = 0
ABC = []
flag = False
while True:
    if flag:
        break
    if isOdd(A) or isOdd(B) or isOdd(C):
        break
    ABC.append([A, B, C])
    A2 = A // 2
    B2 = B // 2
    C2 = C // 2
    A = B2 + C2
    B = A2 + C2
    C = A2 + B2
    cnt += 1

    for i in range(len(ABC)):
        if ABC[i] == [A, B, C]:
            cnt = -1
            flag = True
            break

print(cnt)

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

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

ans = 0
while A % 2 == 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, b, c=map(int, input().split())
if a==b and b==c:
  if a%2==1:
    print(0)
  else:
    print(-1)
else:
  cnt=0
  while(1):
    if a%2==1 or b%2==1 or c%2==1:
      print(cnt)
      break
    cnt+=1
    ha=a/2
    hb=b/2
    hc=c/2
    a=hb+hc
    b=ha+hc
    c=ha+hb

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

while a % 2 == 0 | b % 2 == 0 | c % 2 == 0:
    A = int((b + c) / 2)
    B = int((c + a) / 2)
    C = int((a + b) / 2)
    a = A
    b = B
    c = C
    count += 1
print(count)

Solution (Python):
a,b,c=map(int,input().split())
ct=0
h=0
while 1:
    if (a%2==1)or(b%2==1)or(c%2==1):
        break
    if ct==100000:
        h=1
        break
    a2=a//2
    b2=b//2
    c2=c//2
    a=b2+c2
    b=c2+a2
    c=a2+b2
    ct+=1
if h==1:
    print(-1)
else:
    print(ct)

Solution (Python):
A,B,C = list(map(int,input().split()))
count = 0
if A%2 == 1 or B%2 == 1 or C%2 == 1:
    print(0)
    exit()
if A == B == C:
    print(-1)
    exit()
while True:
    if A%2 == 1 or B%2 == 1 or C%2 == 1:
        break
    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
    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)
    exit()
if a == b == c: 
    print(-1)
    exit()
else:
    count = 0
    while True:
        if a%2 == 1 or b%2 == 1 or c%2 == 1:
            print(count)
            exit()
        else:
            count += 1
            x = (b+c)//2
            y = (c+a)//2
            z = (a+b)//2
            a = x
            b = y
            c = z

Solution (Python):

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


def update(A, B, C):
    return B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2


for i in range(10 ** 5):
    if A & 1 or B & 1 or C & 1:
        print(i)
        exit()
    A, B, C = update(A, B, C)

print(-1)

Solution (Python):

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


def update(A, B, C):
    return B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2


for i in range(10 ** 5):
    if A & 1 or B & 1 or C & 1:
        print(i)
        exit()
    A, B, C = update(A, B, C)

print(-1)

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

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

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

if A == B == C and not A == 1:
    print(-1)
    sys.exit()

while True:
    if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        t_A, t_B, t_C = A, B, C
        A = (t_B + t_C) // 2
        B = (t_C + t_A) // 2
        C = (t_A + t_B) // 2
        ans += 1
    else:
        print(ans)
        break

Solution (Python):
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


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

Solution (Python):
import sys

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


def input():
    return sys.stdin.readline().strip()


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

    for i in range(1000):
        if A % 2 or B % 2 or C % 2:
            print(i)
            return

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

    print(-1)


if __name__ == "__main__":
    main()

Solution (Python):
import copy
a,b,c = map(int,input().split())
cnt = 0
if (a % 2 == 1) or (b % 2 == 1) or (c % 2 == 1):
    print(0)
    exit()
while 1:
    cnt += 1 
    next_a = b // 2 +  c // 2
    next_b = a // 2 + c // 2
    next_c = a // 2 + b // 2
    if a == next_a and b == next_b and c == next_c:
        print(-1)
        break
    elif (next_a % 2 == 1) or (next_b % 2 == 1) or (next_c % 2 == 1):
        print(cnt)
        break
    a = copy.deepcopy(next_a)
    b = copy.deepcopy(next_b)
    c = copy.deepcopy(next_c)

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

for i in range(c):
    if int(a/2)*2==a and int(b/2)*2==b and int(c/2)*2==c:
        if a == b and b == c:
            break
        ans += 1
        x = b / 2 + c / 2
        y = a / 2 + c / 2
        z = b / 2 + a / 2
        a = x
        b = y
        c = z

    else:
        p = 1
        print(ans)
        break



if p == 0:
    print(-1)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def f(x):
    res = 0
    while(x%2==0):
        res += 1
        x //= 2
    return res
def main():
    A,B,C=MI()
    if(A==B==C):
        if(A&1):
            print(0)
        else:
            print(-1)
    else:
        L=[f(A+B),f(B+C),f(C+A)]
        print(min(L))
        

if __name__ == '__main__':
    main()

Solution (Python):
a, b, c = map(int, input().split())
if a == b == c and a % 2 == 0:
    print(-1)
else:
    cnt = 0
    while True:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        _a = (b+c)//2
        _b = (c+a)//2
        _c = (a+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)
    exit()
for i in range(10**8):
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        break
    a_o,b_o,c_o = a,b,c
    a = b_o//2 + c_o//2
    b = a_o//2 + c_o//2
    c = a_o//2 + b_o//2
print(i)

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    A, B, C = readnums()
    if A == B and B == C:
        if A == 1:
            print(0)
        else:
            print(-1)
    else:
        ans = 0
        while all([not A % 2, not B % 2, not C % 2]):
            A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2
            ans += 1

        print(ans)


if __name__ == "__main__":
    main()

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

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

Solution (Python):
cookie = list(map(int, input().split()))
sc = sum(cookie)
cnt = 0
if cookie[0] == cookie[1] and cookie[1] == cookie[2] and cookie[0]%2 == 0:
    print(-1)
    exit()
memo = [0]*3
while cookie[0]%2 == 0 and cookie[1]%2 == 0 and cookie[2]%2 == 0:
    memo[0] = (cookie[1] + cookie[2]) // 2
    memo[1] = (cookie[0] + cookie[2]) // 2
    memo[2] = (cookie[1] + cookie[0]) // 2
    for i in range(3):
        cookie[i] = memo[i]
    cnt += 1

print(cnt)

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:
    count = 0
    while True:
        A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2
        count += 1
        if any(map(lambda x: x % 2 == 1, (A, B, C))):
            break
    print(count)

Solution (Python):

def inp():
    return(int(input()))



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



def instr():
    s = input()
    return(list(s[:len(s)]))



def invr():
    return(map(int, input().split()))


a, b, c = invr()
res = 0

while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == b == c:
        res = -1
        break
    ra = a/2
    rb = b/2
    rc = c/2

    a = ra + rc
    b = rb + ra
    c = rc + rb
    res += 1
print(res)

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:
    for i in range(10**9):
        ans = i
        if a % 2 == 1:
            break
        else:
            tmpa = b/2 + c/2
        if b % 2 == 1:
            break
        else:
            tmpb = c/2 + a/2
        if c % 2 == 1:
            break
        else:
            tmpc = a/2 + b/2
        a = tmpa
        b = tmpb
        c = tmpc
    print(ans)

Solution (Python):
A,B,C = map(int,input().split())
cou = 0
if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
  print("0")
  exit()
while(cou < 10**6):
  cou += 1
  a = A
  b = B
  c = C
  A = b/2 + c/2
  B = a/2 + c/2
  C = a/2 + b/2
  if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
    print(str(cou))
    exit()
  else:
    pass
print("-1")

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

a0, b0, c0 = a, b, c
a1, b1, c1 = 0, 0, 0

cnt = 0
while True:
    if a0%2==1 or b0%2==1 or c0%2==1:
        print(cnt)
        exit()

    a1 = b0//2 + c0//2
    b1 = a0//2 + c0//2
    c1 = a0//2 + c0//2

    a0 = a1
    b0 = b1
    c0 = c1

    cnt += 1

    if a1 == a and b1 == b and c1 == c:
        print(-1)
        exit()

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

	while even_flag:
		if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
			even_flag = False
			break

		elif A == B and B == C and A == C:
			break

		A, B, C = (B // 2 + C // 2), (A // 2 + C // 2), (A // 2 + B // 2)
		count += 1

	if even_flag:
		print(-1)
	else:
		print(count)
		
if __name__ == "__main__":
	main()

Solution (Python):
import math
from collections import deque
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): 
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): 
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} 
def bitArr(n):
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): 
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b,c = readInts()
ans=0

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

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

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

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

C = 1
while 1:
    a, b, c = b//2 + c//2 , a//2 + c//2 , b//2 + a//2
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        print(C)
        sys.exit()
    else:
        C += 1

Solution (Python):
A, B, C = [int(i) for i in input().split()]
ans = 0
a, b, c = A, B, C
while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
    ans += 1
    ha = int(a / 2)
    hb = int(b / 2)
    hc = int(c / 2)
    a = hb + hc
    b = hc + ha
    c = ha + hb
    if a == A and b == B and c == C:
        ans = -1
        break
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,c=map(int,input().split())
    cunt=0
    if a==b and b==c and a%2==0:
        print(-1)
        sys.exit()
    while True:
        if a%2 or b%2 or c%2:
            print(cunt)
            break
        cunt+=1
        a1,b1,c1=a,b,c
        a=(b1+c1)//2
        b=(a1+c1)//2
        c=(a1+b1)//2

if __name__=='__main__':
    main()

Solution (Python):
a,b,c = map(int, input().split(" "))
pr=True
count=0
while(a%2==0 and b%2==0 and c%2==0):
    ta,tb,tc=a,b,c
    a=tb/2+tc/2
    b=ta/2+tc/2
    c=ta/2+tb/2
    count += 1
    if ta == a and tb == b and tc == c:
        print(-1)
        pr=False
        break
if pr:
    print(count)

Solution (Python):
def solve():
    A, B, C = map(int, input().split())
    if A == B == C and A % 2 == 0:
        return -1

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


print(solve())

Solution (Python):
def solve():
    A, B, C = map(int, input().split())
    if A == B == C and A % 2 == 0:
        return -1

    cnt = 0
    while True:
        if A % 2 or B % 2 or C % 2:
            return cnt
        A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2
        cnt += 1


print(solve())

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

    cnt = 0
    while True:
        if A % 2 or B % 2 or C % 2:
            return cnt
        ta = B // 2 + C // 2
        tb = A // 2 + C // 2
        tc = A // 2 + B // 2
        if ta == A and tb == B and tc == C:
            return -1
        A, B, C = ta, tb, tc
        cnt += 1


print(solve())

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

if A%2==1 or B%2==1 or C%2==1:
  print(0)
elif A==B and B==C:
  print(-1)
else:
  count = 0
  while True:
    if A%2==1 or B%2==1 or C%2==1:
      break
    count+=1
    A_tmp = B/2 + C/2
    B_tmp = A/2 + C/2
    C = A/2 + B/2
    A = A_tmp
    B = B_tmp
  print(count)

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

count = 0
while all([a % 2 == 0, b % 2 == 0, c % 2 == 0]):
    if a == b and b == c:
        print(-1)
        exit()
    a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
    count += 1

print(count)

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

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

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

print(count)

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

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

Solution (Python):
l = [list(map(int, input().split()))]
i = 0
while (1):
    a, b, c = map(int,l[i])
    if (a % 2 == 1 or b % 2 == 1 or c % 2 == 1):
        print(i)
        break
    t = [b / 2 + c / 2, c / 2 + a / 2, a / 2 + b / 2]
    if (t in l):
        print(-1)
        break
    l.append(t)
    i+=1

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

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

count = 0

while True:
    if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        if A == B == C:
            print(-1)
            break

        a = B / 2 + C / 2
        b = A / 2 + C / 2
        c = A / 2 + B / 2
        A = a
        B = b
        C = c
        count += 1
    else:
        print(count)
        break

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

ans = 0

while A%2 == B%2 == C%2 == 0:
  ans += 1
  A = A // 2
  B = B // 2
  C = C // 2
  
  if A == B == C:
    ans = -1
    break
  elif A%2 == 1 or B%2 == 1 or C%2 == 1:
    a = A
    b = B
    A = B + C
    B = C + a
    C = a + b

print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,c=map(int,input().split())
    cunt=0
    if a==b and b==c and a%2==0:
        print(-1)
        sys.exit()
    while True:
        if a%2 or b%2 or c%2:
            print(cunt)
            break
        cunt+=1
        a1,b1,c1=a,b,c
        a=(b1+c1)//2
        b=(a1+c1)//2
        c=(a1+b1)//2

if __name__=='__main__':
    main()

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

count = 0
S = 0
T = 0
U = 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):
    count+= 1
    S = 1/2 * A
    T = 1/2 * B
    U = 1/2 * C
    A = T + U 
    B = S + T 
    C = S + U 
  print(count)

Solution (Python):
def func(A, B, C):
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        return 0
    if A == B and B == C:
        return -1
    return func((B+C)//2, (C+A)//2, (A+B)//2) + 1


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

ans = func(A, B, C)

print(ans)

Solution (Python):
a,b,c=map(int,input().split())
ta,ao,su=a,b,c
cnt=0
f=True
while f:
	if ta%2!=0 or ao%2!=0 or su%2!=0:
		f=False
	elif ta==ao==su:
		f=False
		cnt=-1
	else:
		ta=(b+c)/2
		ao=(a+c)/2
		su=(a+b)/2
		cnt+=1
		a=ta
		b=ao
		c=su
print(cnt)

Solution (Python):


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

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

print(ans)

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

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

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

res = 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
    res += 1

print(res)