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,b,c=map(int,input().split())
ans=0
while a%2==0 and b%2==0 and c%2==0:
  d,e,f=0,0,0
  d=(b+c)//2
  e=(a+c)//2
  f=(a+b)//2
  a,b,c=d,e,f
  ans+=1
  if ans==100000:
    break
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(bin(e&-e))-3or~-e^b&1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(bin(e&-e))-3or~b%-2^-e)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(bin(e&-e))-3or~b%-2^e)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(bin(e&-e))-3or~b%-2)

Submission status: Wrong Answer

Solution code:
print(0)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print((e!=b%2)*(e&-e).bit_length()-1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-c|c-b
print((e!=c%2)*(e&-e).bit_length()-1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=b-a|a-c
print((e!=a%2)*(e&-e).bit_length()-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print((e!=b%2)*len(f'{e^e-1:b}')-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print((e!=0)*(e^e-1).bit_length()-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c = map(int, input().split())
    ans = 0
    if a == b and b == a and c == a:
        print(-1)
    else:
        while True:
            if a%2 != 0 or b%2 != 0 or c%2 != 0:
                print(ans)
                break
            a_a = b//2 + c//2
            a_b = a//2 + c//2
            a_c = a//2 + c//2
            a = a_a
            b = a_b
            c = a_c
            ans += 1
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c = map(int, input().split())
    ans = 0
    if a == b and b == a and c == a:
        print(-1)
    else:
        while True:
            if a%2 != 0 or b%2 != 0 or c%2 != 0:
                print(ans)
                break
            a_a = b/2 + c/2
            a_b = a/2 + c/2
            a_c = a/2 + c/2
            a = a_a
            b = a_b
            c = a_c
            ans += 1
resolve()

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print((e^b&1)*(e^e-1).bit_length()-1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=(a-b)|(b-c)
print(bool(e|(a|b|c)%2)*len(f'{e^~-e:b}')-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
## A - Cookie Exchanges
X = list(map(int, input().split()))
Y = [0, 0, 0]
if X[0] == X[1] and X[1] == X[2] and X[2] == X[0]:
    ans = -1
else:
    ans = 0
    while True:
        Y[0] = (X[1] + X[2]) // 2
        Y[1] = (X[2] + X[0]) // 2
        Y[2] = (X[0] + X[1]) // 2
        if sum(Y) == sum(X):
            for i in range(3):
                X[i] = Y[i]
            ans += 1
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
 
if a == b == c:
    print(-1)
    exit()

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

cnt = 1
while cnt:
    a, b, c = int((b+c)/2), int((a+c)/2), int((a+b)/2)
    
    if a % 2 != 0 or \
       b % 2 != 0 or \
       c % 2 != 0: break
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

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

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

cnt = 1
while cnt:
    a, b, c = (b+c)/2, (a+c)/2, (a+b)/2
    
    if a % 2 != 0 or \
       b % 2 != 0 or \
       c % 2 != 0: break
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

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

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

cnt = 1
while cnt:
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    
    if a % 2 != 0 or \
       b % 2 != 0 or \
       c % 2 != 0: break
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

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

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

N = (a + b + c) // 3
cnt = 1
while N:
    if N % 2 != 0: break
    N //= 2
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

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

N = (a+b+c)//3
cnt = 1
while N:
    if N%2!=0: break
    N //= 2
    cnt += 1
    
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ab,bc,ca=abs(a-b),abs(b-c),abs(c-a)
ans=0
if a==b==c or a%2!=0 or b%2!=0 or c%2!=0:
  print(-1)
else:
  while ab%2==0 and bc%2==0 and ca%2==0:
    ab//=2
    bc//=2
    ca//=2
    ans+=1
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a, b, c = [int(w) for w in input().split()]

ans = 0


def is_fin(a, b, c):
    global ans
    if a == b == c:
        ans = -1
        return True
    elif a % 2 or b % 2 or c % 2:
        return True
    else:
        return False


while not is_fin(a, b, c):
    ta = (b+c)/2
    tb = (a+c)/2
    tc = (a + b) / 2
    a, b, c = ta, tb, tc
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
count = 0
for i in range(10**9+1):
    a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2
    count += 1
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        print(count)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
count = 0
for i in range(10**7):
    a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2
    count += 1
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        print(count)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
count = 0
for i in range(10**3):
    a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2
    count += 1
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        print(count)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
def check(A,B,C):
  if A==0 or B==0 or C==0:
    return False
  if A%2!=0 or B%2!=0 or C%2!=0:
    return False
  return True

A,B,C=map(int,input().split())
ans=0
if A==B==C:
  print(-1)
  exit()
while check(A,B,C)==True:
  a=B//2+C//2
  b=A//2+C//2
  c=A//2+B//2
  A,B,C=a,b,c
  ans+=1
  if 10**9<ans:
    ans=-1
    break
print(ans)

Submission status: Wrong Answer

Solution code:
def check(A,B,C):
  if A==0 or B==0 or C==0:
    return False
  if A%2!=0 or B%2!=0 or C%2!=0:
    return False
  return True

A,B,C=map(int,input().split())
ans=0
if A==B==C:
  print(-1)
  exit()
while check(A,B,C)==True:
  a=B//2+C//2
  b=A//2+C//2
  c=A//2+B//2
  A,B,C=a,b,c
  print(A,B,C)
  ans+=1
  if 10**9<ans:
    ans=-1
    break
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
sum = A + B + C
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 2 == 1 or c[i] % 2 == 1:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1
    if i == 10 ** 9 - 1:
        count = -1

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
sum = A + B + C
for i in range(10 ** 9 + 1):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 2 == 1 or c[i] % 2 == 1:
        break
    elif a[i] + b[i] + c[i] != sum:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9 + 1):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 2 == 1 or c[i] % 2 == 1:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 2 == 1 or c[i] % 2 == 1:
        if count == 0:
            count += 1
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 2 == 1 or c[i] % 2 == 1:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 2 == 0 or c[i] % 2 == 1:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 1 == 0 or c[i] % 2 == 1:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1
    else:
        break

print(count)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
y = 2
x = 0
i = 0
if a == b and b==c:
  print(-1)
elif a % 2 != 0 or b % 2 !=0 or c % 2 != 0:
  print(0)
else:  
  while y in range(2,10001,y):
    d = (a/(2))/y
    f =(c/(2))/y          
    e = (b/2)/y
    if d % 1 == 0:
      x += 1    
    if e % 1 == 0:
      x += 1
    if f % 1 == 0:
      x += 1
    y = 2**i
  print(x)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
y = 2
x = 0
i = 0
if a == b and b==c:
  print(-1)
else:  
  while y in range(2,10001,y):
    d = (a/(2))/y
    f =(c/(2))/y          
    e = (b/2)/y
    if d % 1 == 0:
      x += 1    
    if e % 1 == 0:
      x += 1
    if f % 1 == 0:
      x += 1
    y = 2**i
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
member = list(map(int, input().split()))

def check_odd():
    for m in member:
        if m % 2 != 0:
            return True
    return False

def check_number():
    num = member[2]
    for i in range(2):
        if num != member[i]:
            return True
    return False

if check_number():
    count = 0
    while True:
        if check_odd():
            break
        else:
            a = member[1] // 2 + member[2] // 2
            b = member[0] // 2 + member[2] // 2
            c = member[0] // 2 + member[1] // 2
            member = [a, b, c]
        count += 1
    print(count)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
X=[int(x) for x in input().split()]
count=0
if ((X[0]%2-1)*(X[1]%2-1)*(X[2]%2-1)!=0 and X[0]==X[1] and X[1]==X[2]):
  count=-1
else:
  while((X[0]%2-1)*(X[1]%2-1)*(X[2]%2-1)!=0):
    X[0]=(X[1]+X[2])/2
    X[1]=(X[0]+X[2])/2
    X[2]=(X[1]+X[0])/2
    count =count+1
print(count)

Submission status: Wrong Answer

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

count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
count=0
if A==B and B==C :
    print(-1)
else :
    while True :
        if A%2 != 0 or B%2 != 0 or C%2 != 0 :
            print(count)
            break
        elif A==B and B==C :
            print(-1)
            break
        else :
            count += 1
            dA=A
            dB=B
            dC=C
            A=dB/2+dC/2
            B=dA/2+dC/2
            C=dA/2+dB/2

Submission status: Wrong Answer

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

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

  if a%2 == 1 or b%2 == 1 or c%2 ==1:
    break
  r += 1
  aa = (b+c)//2
  bb = (a+c)//2
  cc = (a+b)//2
  a,b,c = aa,bb,cc

print(r)

Submission status: Wrong Answer

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

while True:
  if a%2 == 1 or b%2 == 1 or c%2 ==1:
    break
  r += 1
  aa = (b+c)//2
  bb = (a+c)//2
  cc = (a+b)//2
  a,b,c = aa,bb,cc

print(r)

Submission status: Wrong Answer

Solution code:
def ave(b,c):
    return b//2 + c//2
def rest(a,b,c):
    return ave(b,c), ave(a,c), ave(b,a)
a, b, c = map(int, input().split())
ans = 0
while 1:
    d, e, f = rest(a,b,c)
    if (a, b, c) == (d, e, f):
        print(-1)
        break
    ans += 1
    a, b, c = d, e, f
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1 :
        print(ans)
        break

Submission status: Wrong Answer

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

if any(i % 2 != 0 for i in [a, b, c]):
    print(1)
    exit()

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

cnt = 0
a_list = [0]*(1001001)
b_list = [0]*(1001001)
c_list = [0]*(1001001)
a_list[0] = a
b_list[0] = b
c_list[0] = c

for i in range(1, 10**9):
    a_list[i] = (b_list[i-1] + c_list[i-1]) // 2
    b_list[i] = (c_list[i-1] + a_list[i-1]) // 2
    c_list[i] = (a_list[i-1] + b_list[i-1]) // 2
    cnt += 1
    if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:
        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()

cnt = 0
a_list = [0]*(1001001)
b_list = [0]*(1001001)
c_list = [0]*(1001001)
a_list[0] = a
b_list[0] = b
c_list[0] = c

for i in range(1, 10**9):
    a_list[i] = (b_list[i-1] + c_list[i-1]) // 2
    b_list[i] = (c_list[i-1] + a_list[i-1]) // 2
    c_list[i] = (a_list[i-1] + b_list[i-1]) // 2
    cnt += 1
    if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:
        break

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
cookie = list(map(int,input().split()))
odd = False
cnt = 0
if len(list(set(cookie))) == 1 and cookie[0]%2==0:
    print('-1')
else:
    while not odd:
        tmp = [0 for i in range(3)]
        for i in range(3):
            ix = list(set([0,1,2]) - set([i]))
            tmp[ix[0]] += cookie[i] / 2
            tmp[ix[1]] += cookie[i] / 2
        for i in tmp:
            if not i % 2 == 0:
                odd = True
        cookie = tmp
        cnt += 1
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
cookie = list(map(int,input().split()))
odd = False
cnt = 0
if len(list(set(cookie))) == 1:
    print('-1')
else:
    while not odd:
        tmp = [0 for i in range(3)]
        for i in range(3):
            ix = list(set([0,1,2]) - set([i]))
            tmp[ix[0]] += cookie[i] / 2
            tmp[ix[1]] += cookie[i] / 2
        for i in tmp:
            if not i % 2 == 0:
                odd = True
        cookie = tmp
        cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=list(map(int,input().split()))
if a==b and b==c and c==a:
  print('-1')
n=0
while a%2==0 and b%2==0 and c%2==0:
  temp_a = c/2+b/2
  temp_b = a/2+c/2
  temp_c = a/2+b/2
  a = temp_a
  b = temp_b
  c = temp_c
  n+=1
print(n)

Submission status: Wrong Answer

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

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

ans=0    
while all(i&1==0 for i in [a,b,c]):
    a,b,c = (b+c)//2, (a+c)//2, (a+b)//2
    ans+=1

print(ans)

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = 0
#aa,bb,cc = 0

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a == b == c:
    print(-1)
    exit()
for i in range(0, 10**6):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i)
        exit()
    a, b, c = (b+c) / 2, (c+a)/2, (a+b)/2

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a == b == c:
    print(-1)
    exit()
for i in range(0, 10**5):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i)
        exit()
    a, b, c = (b+c) / 2, (c+a)/2, (a+b)/2

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a == b == c:
    print(-1)
for i in range(1, 10**5):
    a, b, c = (b+c) / 2, (c+a)/2, (a+b)/2
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

A, B, C = MAP()

if any(x%1 != 0 for x in [A, B, C]):
	print(0)
	exit()

l = [(A, B, C)]

flg = True
cnt = 0
while 1:
	a = (B+C)/2
	b = (A+C)/2
	c = (A+B)/2
	if any(x%1 != 0 for x in [a, b, c]):
		print(cnt)
		exit()
	elif (a, b, c) in l:
		print(-1)
		exit()
	else:
		A, B, C = a, b, c
		l.append((A, B, C))
		cnt += 1

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

A, B, C = MAP()

if any(x%1 for x in [A, B, C]):
	print(0)
	exit(9)

l = [(A, B, C)]

flg = True
cnt = 0
while 1:
	a = (B+C)/2
	b = (A+C)/2
	c = (A+B)/2
	if any(x%1 for x in [a, b, c]):
		print(cnt)
		exit()
	elif (a, b, c) in l:
		print(-1)
		exit()
	else:
		A, B, C = a, b, c
		l.append((A, B, C))
		cnt += 1

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if (a+b)%4 == (b+c)%4 == (c+a)%4 == 0:
    print(-1)
else:
    counter = 0
    while a%2==b%2==c%2==0:
        a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
        counter += 1
    print(counter)

Submission status: Wrong Answer

Solution code:
abc = list(map(int, input().split()))
ans = 0
for i in range(10 ** 6):   
    if abc[0] % 2 != 0:
        print(ans)
        break
    else:
        tmp1 = abc[1] // 2 + abc[2] // 2

    if abc[1] % 2 != 0:
        print(ans)
        break
    else:
        tmp2 = abc[0] // 2 + abc[2] // 2
        
    if abc[2] % 2 != 0:
        print(ans)
        break
    else:
        tmp3 = abc[0] // 2 + abc[2] // 2
        
    abc[0] = tmp1
    abc[1] = tmp2
    abc[2] = tmp3
    ans += 1

print(-1)

Submission status: Wrong Answer

Solution code:
import sys
a,b,c=map(int,input().split())
ans=0
if a%2==1 or b%2==1 or c%2==1:
    print(-1)
    sys.exit()
if a%2==0 and a==b==c:
    print(-1)
    sys.exit()
while a%2==0 and b%2==0 and c%2==0:
    ta=a/2
    tb=b/2
    tc=c/2
    a=tb+tc
    b=ta+tc
    c=ta+tb
    ans+=1
print(ans)

Submission status: Wrong Answer

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

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

print(c)

Submission status: Wrong Answer

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

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

print(c)

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

if A == B == C:
    if A % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 0
    while True:
        A, B, C = (B + C) / 2, (A + C) / 2, (A + B) / 2
        cnt += 1

        if A % 2 + B % 2 + C % 2 >= 1:
            break

    print(cnt)

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

Submission status: Wrong Answer

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

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

while True:
    ans += 1
    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    if x%2 == 1 or y%2 == 1 or z%2 == 1:
        break
    else:
        a = x
        b = y
        c = z

print(ans)

Submission status: Wrong Answer

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

if a == b == c:
    if a%2 == 0:
        print(-1) #無限
    else:
        print(ans) #1回もできない
    exit()

while True:
    ans += 1
    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    if x%2 == 1 or y%2 == 1 or z%2 == 1:
        break
    else:
        a = x
        b = y
        c = z

print(ans)

Submission status: Wrong Answer

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

if a == b == c:
    if a%2 == 0:
        print(-1) #無限
    else:
        print(ans) #1回もできない

while True:
    ans += 1
    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    if x%2 == 1 or y%2 == 1 or z%2 == 1:
        break
    else:
        a = x
        b = y
        c = z

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int,input().split())
ans = 0
if a == b == c:
    if a%2 == 0:
        print(-1) #無限
    else:
        print(ans) #1回もできない

while True:
    ans += 1
    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    if x%2 == 1 or y%2 == 1 or z%2 == 1:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
cnt = 0
while A%2 == B%2 == C%2 == 0:
    x = (B+C)//2
    y = (A+C)//2
    z = (A+B)//2
    A = x
    B = y
    C = z
    cnt += 1
if A == B == C:
    print(-1)
else:
    print(cnt)