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



Sample input:
4 12 20


Sample output:
3

Submission status: Wrong Answer

Solution code:
# A - Cookie Exchanges

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

if A==B and B==C:
    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)

Submission status: Wrong Answer

Solution code:
# A - Cookie Exchanges

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

def div2(x):
    ans = 0
    while x>0 and x%2==0:
        x /= 2
        ans += 1
    return ans

if A==B and B==C:
    print(-1)
else:
    print(min(div2(abs(A-B)), div2(abs(A-C))))

Submission status: Wrong Answer

Solution code:
# A - Cookie Exchanges

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

def div2(x):
    ans = 0
    while(x%2==0):
        x /= 2
        ans += 1
    return ans

if A==B and B==C:
    print(-1)
else:
    print(min(div2(abs(A-B)), div2(abs(A-C))))

Submission status: Wrong Answer

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

if A == B == C:
    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)

Submission status: Wrong Answer

Solution code:
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:
    a1 = a
    b1 = b
    c1 = c
    a = (b1+c1)/2
    b = (a1+c1)/2
    c = (a1+b1)/2
    ans += 1
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a == b == c:
  if a % 2 == 0:
    print(-1)
  else:
    print(1)
else:
  ans = 0
  while a % 2 != 0 or b % 2 != 0:
    a1 = a
    b1 = b
    c1 = c
    a = (b1+c1)/2
    b = (a1+c1)/2
    c = (a1+b1)/2
    ans += 1
  print(ans)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A == B == C:
  print(-1)
else:
  count = 0
  while not (A == B == C) and (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("A: {}, B: {}, C: {}".format(A, B, C))
  if A == B == C:
    print(-1)
  else:
    print(count)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A == B == C:
  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("A: {}, B: {}, C: {}".format(A, B, C))
  print(count)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A == B == C:
  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
    count += 1
  print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
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
#@lru_cache(maxsize=None)
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
#import numpy as np
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):#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 not(a==b and b==c) and a%2==0 and b%2==0 and c%2==0:
        print(-1)
    else:
        print(cnt)
main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
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
#@lru_cache(maxsize=None)
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
#import numpy as np
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):#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:
        print(-1)
    else:
        print(cnt)
main()

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
count=0
h=sorted([a,b,c])
if a==b==c:
    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
        if sorted([a,b,c])==h:
            print(-1)
        else:
            print(count)
            break

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
count=0
if a==b==c:
    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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
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))
#%%code

#なお、任意の整数 M に対して M の −2 進数表現が一意に定まることが証明できます。
#2桁ごとに見るとよかった（もう実験したよ）
def resolve():
    A=list(pin())
    ans=0
    for i in range(10**6):
        #print(A)
        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)
    
                
    
#%%submit!
#resolve()

Submission status: Wrong Answer

Solution code:
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:
  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)

Submission status: Wrong Answer

Solution code:
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:
  print(-1)
  exit()
cnt = 0
while A % 2 != 1 and B % 2 != 1 and C % 2 != 1:
  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)

Submission status: Wrong Answer

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

while x % 2 == 0 and y % 2 == 0:
  x, y = x // 2, y // 2
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
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:
        print(-1)
        break
    else:
        test.append([a,b,c])
if test != [a,b,c]:
    print(count)

Submission status: Wrong Answer

Solution code:
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 test== [a,b,c]:
        print(-1)
        break

if test != [a,b,c]:
    print(count)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A == B == C:
    print(-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)

Submission status: Wrong Answer

Solution code:
def main():
    A,B,C=map(int,input().split())
    tmp=[0]*2
    ans=-1
    if A==B==C:
        print(ans)
    else:
        for _ in range(10**9):
            if C-A != ((C-A)//2) * 2:
                print(ans)
                exit()
            tmp[0]=max((A+B)/2,(B+C)/2,(C+A)/2)
            tmp[1]=min((A+B)/2,(B+C)/2,(C+A)/2)
            A=tmp[1]
            C=tmp[0]
            ans += 1

main()

Submission status: Wrong Answer

Solution code:
def main():
    A,B,C=map(int,input().split())
    tmp=[0]*3
    ans=0
    if A==B==C:
        print(-1)
    else:
        for _ in range(10**9):
            if A%2 or B%2 or C%2:
                print(ans)
                exit()
            tmp[0]=(B+C)/2
            tmp[1]=(A+C)/2
            tmp[2]=(A+B)/2
            A=tmp[0]
            B=tmp[1]
            C=tmp[2]
            ans += 1

main()

Submission status: Wrong Answer

Solution code:
a , b , c = map(int, input().split())
count = 0
if 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)

Submission status: Wrong Answer

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

x=0
if A==B and A==C:
    print(-1)
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
            #print(A,B,C)
        else:
            break
    print(x)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
aa=0
bb=0
cc=0
cnt = 0
e = True
if a%2!=0 or b%2!=0 or c%2!=0:
	print(0)
else:
	while e:
		if a%2!=0 or b%2!=0 or c%2!=0:
			e=False
		elif a==b==c:
			cnt=-1
			e=False
		else:
			aa=(b+c)/2
			bb=(a+c)/2
			cc=(a+b)/2
			cnt+=1
			a=aa
			b=bb
			c=cc
print(cnt)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

ans = 0
while True:
  if len(set((a,b,c)))<3:
    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)

Submission status: Wrong Answer

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

ans = 0
while True:
  if len(set((a,b,c)))<3:
    print(-1)
    break
  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)

Submission status: Wrong Answer

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

ans = 0
while True:
  if len(set((a,b,c)))<3:
    print(-1)
    break
  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
    print(a,b,c)
  else:
    break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c = tuple(map(int,input().split()))
if len(set((a,b,c)))<3:
  print(-1)
else:
  ans = 0
  while True:
    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)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
f=True
aa=0
bb=0
cc=0
cnt=0
while f:
	aa = b/2+c/2
	bb = a/2+c/2
	cc = a/2+b/2
	cnt+=1
	if aa == bb == cc:
		cnt=-1
		break
	if aa%2!=0 or bb%2!=0 or cc%2!=0:
		f=False
	else:
		a=aa
		b=bb
		c=cc
	
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
f=True
aa=0
bb=0
cc=0
cnt=0
while f:
	aa = b/2+c/2
	bb = a/2+c/2
	cc = a/2+b/2
	cnt+=1
	if aa == a and bb == b and cc == c:
		cnt = -1
		break
	if aa%2!=0 or bb%2!=0 or cc%2!=0:
		f=False
	else:
		a=aa
		b=bb
		c=cc
	
print(cnt)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
if A==B==C:
  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)

Submission status: Wrong Answer

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

if a == b and b == c:
    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)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
A, B, C = map(int, input().split())
count = 0

if A == B == C:
    print(-1)
    exit()
while True:
    if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
        print(count)
        break
    count += 1
    A1 = A
    B1 = B
    C1 = C
    A = B1//2 + C1//2
    B = A1//2 + C1//2
    C = A1//2 + B1//2

Submission status: Wrong Answer

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

for _ in range(10**4):
    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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c = map(int, input().split())
    count = 0
    while True:
        _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
            if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
                break
            
    print(count)


resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c = map(int, input().split())
    count = 0
    while True:
        _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:
            count += 1
            if _a % 2 != 0 or _b % 2 != 0 or _c % 2 != 0:
                break
            a, b, c = _a, _b, _c

    print(count)


resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c = map(int, input().split())
    count = 0
    while True:
        _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:
            if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
                break
            a, b, c = _a, _b, _c
            count += 1

    print(count)


resolve()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

# A - Cookie Exchanges
def count(n):
	i = 0
	
	while n % 2 == 0:
		n /= 2
		i += 1
	
	return i


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


def get_molecules():
	n = param // 3
		
	if divide_count % 2 == 0:
		return [n + 1, n]
	else:
		return [n, n + 1]


def recalc(c1, c2, c3):
	return (c1*mols[0])//param + ((c1+c2)*mols[1]//param)


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

if a == b == c and a % 2 == 0:
	print(-1)
else:
	divide_count = min(count(a), count(b), count(c))
	
	if divide_count == 0:
		print(0)
	else:
		while is_even():
			param = pow(2, divide_count)
			mols = get_molecules()
			
			a = recalc(a, b, c)
			b = recalc(b, a, c)
			c = recalc(c, a, b)
			
			divide_count += 1
		
		print(divide_count - 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if  A==B and A==C:
    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)

Submission status: Wrong Answer

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

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

while True:
    if  A==B and A==C:
        cnt = -1
        break
        
    elif 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)

Submission status: Wrong Answer

Solution code:
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:
    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)

Submission status: Wrong Answer

Solution code:
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:
    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)

Submission status: Wrong Answer

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

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

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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(lambda x:int(x),input().split())
if a==b==c:
  print(-1)
else:
  reps = 0
  while a%2==0 and b%2==0 and c%2==0:
    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)

Submission status: Wrong Answer

Solution code:
a,b,c = map(lambda x:int(x),input().split())
if a==b==c:
  print(-1)
elif a%2==1 or b%2==1 or c%2==1:
  print(0)
else:
  at=bt=ct = -1
  while a%2==0:
    a/=2
    at+=1
  while b%2==0:
    b/=2
    bt+=1
  while c%2==0:
    c/=2
    ct+=1
  print(at+bt+ct)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if A == B == C:
    print(-1)
else:
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        t = B / 2 + C / 2
        a = A / 2 + C / 2
        s = A / 2 + B / 2
        A = t
        B = a
        C = s
        count += 1

    print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
ans = 0
if a==b==c:
    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)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int, input().split())
cnt=0
while True:
  if A==B and A==C:
    print(-1)
    exit(0)
  if not (A%2==0 and B%2==0 and C%2==0):
    break
  cnt+=1
  A=A//2
  B=B//2
  C=C//2
  Aa=B+C
  Bb=A+C
  Cc=A+B
  A=Aa
  B=Bb
  C=Cc
print(cnt)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int, input().split())
cnt=0
while True:
  A=A//2
  B=B//2
  C=C//2
  flgA=A%2==0
  flgB=B%2==0
  flgC=C%2==0
  Aa=B+C
  Bb=A+C
  Cc=A+B
  A=Aa
  B=Bb
  C=Cc

  cnt+=1
  if A==B and A==C:
    print(-1)
    exit(0)
  if [flgA, flgB, flgC].count(True) !=3:
    break

print(cnt)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int, input().split())
if A==B and B==C:
  print('-1')
  exit(0)

cnt=0
ctr=0
while True:
  A=A//2
  B=B//2
  C=C//2
  flgA=A%2==0
  flgB=B%2==0
  flgC=C%2==0
  Aa=B+C
  Bb=A+C
  Cc=A+B
  A=Aa
  B=Bb
  C=Cc

  cnt+=1
  ctr+=1
  if [flgA, flgB, flgC].count(True) !=3:
    break
  if ctr >=100:
    print('-1')
    exit(0)

print(cnt)