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())
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 or ctr >=100:
    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
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 [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
while True:
  A=A//2
  B=B//2
  C=C//2
  flgA=A%2==0
  flgB=B%2==0
  flgC=C%2==0
  A=B+C
  B=A+C
  C=A+B
  if [flgA, flgB, flgC].count(True) ==2 or [flgA, flgB, flgC].count(False) ==3:
    break
  else:
    cnt+=1
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
while True:
  A=A/2
  B=B/2
  C=C/2
  if A%2==0 and B%2==0 and C%2==0:
    A=B+C
    B=A+C
    C=A+B
    cnt+=1
  else:
    break
print(cnt)

Submission status: Wrong Answer

Solution code:
import re
A,B,C = map(int,input().split())
#N = str(input())
#K = int(input())
#A = list(map(int,input().split()))
if A==B==C:
    print(-1)
    exit()
flag=True
co=0
if A%2!=0 or B%2!=0 or C%2!=0:
    flag=False
while flag==True:
    co+=1

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

print(co)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
## libs ##
from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left

#======================================================#

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def solve(A, B, C):
    if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
        return 1
    elif (A == B == C):
        return -1
    else:
        return solve((B/2 + C/2), (A/2 + C/2), (A/2 + B/2)) + 1 

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

Submission status: Wrong Answer

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

if a== b and b==c and c==a :
    print(-1)
else:
    count = 0 
    while(a%2==0 and b%2==0 and c%2 ==0):
        new_a, new_b, new_c = b//2 + c//2, a//2 + c//2, a//2 + b//2
        a, b, c = new_a, new_b, new_c
        count+=1
    print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
if A == B == C:
    ans = -1
else:
    count = 0
    while (A % 2 == B % 2 == C % 2 == 0):
        w1 = (B/2 + C/2) 
        w2 = (A/2 + C/2)
        w3 = (A/2 + B/2)
        A = w1
        B = w2
        C = w3
        count += 1
    ans = count

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

ans=0
while True:
    if a==b==c:
        ans=-1
        break
    if a%2==1 or b%2==1 or c%2==1:
        break
    ans+=1
    na=(b+c)/2
    nb=(c+a)/2
    nc=(a+b)/2
    a=na
    b=nb
    c=nc
print(ans)

Submission status: Wrong Answer

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

if A == B == C:
  result = -1
else:
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    result += 1
    a = A/2
    b = B/2
    c = C/2
    A = b + c
    B = a + c
    C = b + a
   
print(result)

Submission status: Wrong Answer

Solution code:

def solve():
    A,B,C = map(int, input().split())
    ans = 0
    a = A
    b = B
    c = C
    while(True):
        x = int((b + c)/ 2)
        y = int((a + c)/ 2)
        z = int((a + b)/2)

        a = x
        b = y
        c = z

        ans += 1

        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            print(ans)
            return
        elif a == A and b == B and c == C:
            print(-1)
            return

solve()

Submission status: Wrong Answer

Solution code:

a, b, c = list(map(int, input().split(' ')))
cnt = 0
if a == b == c:
    cnt = -1  
else:
    while (a+1)%2 or (b+1)%2 or (c+1)%2:
        cnt += 1
        a,b,c=(b+c)/2,(a+c)/2,(a+b)/2

print(cnt)

Submission status: Wrong Answer

Solution code:

a, b, c = list(map(int, input().split(' ')))
cnt = 0
if a == b == c:
    cnt = -1  
else:
    while not (a%2 or b%2 or c%2):
        cnt += 1
        a,b,c=(b+c)/2,(a+c)/2,(a+b)/2

print(cnt)

Submission status: Wrong Answer

Solution code:

def waru2cnt(n):
    cnt = 0
    while n % 2 == 0 and n != 0:
        n //= 2
        cnt += 1
    return cnt

a = list(map(int, input().split(' ')))
a.sort()
x = 2 * a[2] - a[1] - a[0] 

print([waru2cnt(x),-1][x==0])

Submission status: Wrong Answer

Solution code:
A,B,C = list(map(int, input().split()))
count=0
while True:
    if  A==B and B==C and C==A:
        print(-1)
        break 
    elif A%2==0 and B%2==0 and C%2 == 0:
        A2 = 0.5*A
        B2 = 0.5*B
        C2 = 0.5*C
        A = B2+C2
        B = C2+A2
        C = A2+B2
        count=count+1
    elif A%2 ==1or B%2 ==1 or C%2 ==1:
        print(count)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
if a==b==c:
    print(-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
        count += 1
    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
i = 0
while a%2==0 and b%2==0 and c%2==0 and i<10**8:
    at = a//2
    bt = b//2
    ct = c//2
    a = bt + ct
    b = at + ct
    c = at + bt
    i+=1
if i > 10**8:
    print(-1)
else:
    print(i)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
i = 0
while a%2==0 and b%2==0 and c%2==0 and i<10**3:
    at = a//2
    bt = b//2
    ct = c//2
    a = bt + ct
    b = at + ct
    c = at + bt
    i+=1
if i > 10**3:
    print(-1)
else:
    print(i)

Submission status: Wrong Answer

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

def operation(a,b,c):
    a_ = (b+c)/2
    b_ = (a+c)/2
    c_ = (a+b)/2
    return a_,b_,c_

if A == B == C:
    print(-1)
else:
    r = 0
    while A%2 == 0 and B%2 == 0 and C%2 == 0:
        A,B,C = operation(A,B,C)
        r += 1
    print(r)

Submission status: Wrong Answer

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

def divide2(x):
    r = 0
    while x%2 == 0:
        r += 1
        x = x/2
    return r

if A == B == C:
    print(-1)
else:
    print(min(divide2(A+B),divide2(B+C),divide2(C+A)))

Submission status: Wrong Answer

Solution code:
def resolve():
    a,b,c=map(int, input().split())
    if a+b==a+c==b+c:
        print(-1)
    else:
        cnt=0
        while a%2==b%2==c%2==0:
            a_new=(b+c)//2
            b_new=(a+c)//2
            c_new=(a+b)//2
            a=a_new
            b=b_new
            c=c_new
            cnt+=1
        print(cnt)

resolve()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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

ans = 0

if A == B and  B == C:
    ans = -1
else:
    while A%2 == 0 and B%2 == 0 and C%2 == 0:
        next_a = C/2 + B/2
        next_b = A/2 + C/2
        next_c = A/2 + B/2
        A = next_a
        B = next_b
        C = next_c
        ans += 1


print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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

ans = 0

if A == B and  B == C:
    ans = -1
else:
    while A%2 == 0 and B%2 == 0 and C%2 == 0:
        next_a =int( C/2 + B/2)
        next_b =int( A/2 + C/2)
        next_c =int( A/2 + B/2)
        A = next_a
        B = next_b
        C = next_c
        ans += 1
        if A == B and B == C:
            ans = -1
            break


print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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

ans = 0

if A == B and  B == C:
    ans = -1
else:
    while A%2 == 0 and B%2 == 0 and C%2 == 0:
        next_a =int( C/2 + B/2)
        next_b =int( A/2 + C/2)
        next_c =int( A/2 + B/2)
        A = next_a
        B = next_b
        C = next_c
        ans += 1
        if A == B and B == C:
            ans = -1


print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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:
        next_a =int( C/2 + B/2)
        next_b =int( A/2 + C/2)
        next_c =int( A/2 + B/2)
        A = next_a
        B = next_b
        C = next_c
        ans += 1

    print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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

ans = 0

if A == B and  B == C:
    print(-1)
else:
    while 1:
        next_a =int( C/2 + B/2)
        next_b =int( A/2 + C/2)
        next_c =int( A/2 + B/2)
        A = next_a
        B = next_b
        C = next_c
        ans += 1
        if A%2 != 0 or B %2 != 0 or C%2 != 0:
            print(ans)
            exit()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
from fractions import gcd
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

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

def readInts():
  return list(map(int,input().split()))
def main():
    a,b,c = readInts()
    ab = abs(a-b)
    bc = abs(b-c)
    cnt = 0
    if ab == 0 and bc == 0:
        print('-1')
        exit()
    while True:
        if ab % 2 == 0 and bc % 2 == 0:
            ab //= 2
            bc //= 2
            cnt += 1
        else:
            break
    print(cnt)

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
from fractions import gcd
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

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

def readInts():
  return list(map(int,input().split()))
def main():
    a,b,c = readInts()
    g = gcd(a,b)
    g = gcd(g,c)
    if g == a == b == c:
        print(-1)
    else:
        print(g-1)
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
count = 0
if a==b and b==c:
    count = -1
else:
    while True:
        if a%2==1 or b%2==1 or c%2==1:
            break
        d = a;e = b
        a = b//2 + c//2
        b = d//2 + c//2
        c = d//2 + e//2
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import math
import sys

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

cnt = 0
while(True):
    half_a, half_b, half_c = a / 2, b / 2, c / 2
    ea = half_a % 2 == 0
    eb = half_b % 2 == 0
    ec = half_c % 2 == 0
    if (ea and eb and ec or (not ea) and (not eb) and (not ec)):
        cnt += 1
        a = half_b + half_c
        b = half_a + half_c
        c = half_a + half_b
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
import sys

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

if (a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
    cnt = 1
else:
    print(0)
    sys.exit()

while(True):
    half_a, half_b, half_c = a / 2, b / 2, c / 2
    ea = half_a % 2 == 0
    eb = half_b % 2 == 0
    ec = half_c % 2 == 0
    if (ea and eb and ec or (not ea) and (not eb) and (not ec)):
        cnt += 1
        a = half_b + half_c
        b = half_a + half_c
        c = half_a + half_b
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
import sys

a, b, c = map(int, input().split())
cnt = 0
if (a == b == c):
    print(-1)
    sys.exit()


while(True):
    cnt += 1
    half_a, half_b, half_c = a / 2, b / 2, c / 2
    ea = half_a % 2 == 0
    eb = half_b % 2 == 0
    ec = half_c % 2 == 0
    if (ea and eb and ec or (not ea) and (not eb) and (not ec)):
        a = half_b + half_c
        b = half_a + half_c
        c = half_a + half_b
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
import sys

a, b, c = map(int, input().split())
cnt = 0
if (a == b == c):
    print(-1)
    sys.exit()


while(True):
    half_a, half_b, half_c = a / 2, b / 2, c / 2
    ea = a % 2 == 0
    eb = b % 2 == 0
    ec = c % 2 == 0
    if (ea and eb and ec or (not ea) and (not eb) and (not ec)):
        cnt += 1
        a = half_b + half_c
        b = half_a + half_c
        c = half_a + half_b
    else:
        break

print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

i = 0
a_, b_, c_ = a, b, c

while a%2 == 0 and b%2 == 0 and c%2 == 0:
    i += 1
    a = b_//2 + c_//2
    b = a_//2 + c_//2
    c = a_//2 + b_//2
    a_, b_, c_ = a, b, c

print(i)

Submission status: Wrong Answer

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

def readlines(n):
    for _ in range(n):
        yield map(int, input().split())


def main():
    a, b, c = map(int, input().split())
    if a == b == c:
        yield -1
        return

    while all(x%2 == 0 for x in (a, b, c)):
        a_ = a//2
        b_ = b//2
        c_ = c//2
        a, b, c = b_+c_, a_+c_, a_+b_
        yield 1


print(sum(main()))

Submission status: Wrong Answer

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

if A==B==C:
    print(-1)
else:
    for i in range(100000000):
        if A %2==0 and B%2==0 and C%2==0:
            a = A/2
            b = B/2
            c = C/2
            A = b+c
            B = a+c
            C = a+b
        else:
            print(i)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
import math

input = sys.stdin.readline

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


if A == B == C and A%2 != 0 and B%2 != 0 and C%2 != 0 :
    print(-1)
else:
    cnt = 0
    while(1):
        #print(A,B,C)
        #print(A/2+C/2,B/2+A/2,C/2+B/2)
        x = B/2+C/2
        y = A/2+C/2
        z = B/2+A/2
        A = x
        B = y
        C = z
        cnt += 1
        if A%2 != 0 or B %2 != 0 or C%2 != 0 :
            print(cnt)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
import math

input = sys.stdin.readline

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


if A == B == C or A%2 != 0 or B%2 != 0 or C%2 != 0 :
    print(-1)
else:
    cnt = 0
    while(1):
        #print(A,B,C)
        #print(A/2+C/2,B/2+A/2,C/2+B/2)
        x = B/2+C/2
        y = A/2+C/2
        z = B/2+A/2
        A = x
        B = y
        C = z
        cnt += 1
        if A%2 != 0 or B %2 != 0 or C%2 != 0 :
            print(cnt)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
import math

input = sys.stdin.readline

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


if A == B == C:
    print(-1)
else:
    cnt = 0
    while(1):
        #print(A,B,C)
        #print(A/2+C/2,B/2+A/2,C/2+B/2)
        x = B/2+C/2
        y = A/2+C/2
        z = B/2+A/2
        A = x
        B = y
        C = z
        cnt += 1
        if A%2 != 0 or B %2 != 0 or C%2 != 0 :
            print(cnt)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
import math

input = sys.stdin.readline

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


if A == B == C:
    print(-1)
else:
    for i in range(1,1000000):
        #print(A,B,C)
        #print(A/2+C/2,B/2+A/2,C/2+B/2)
        x = B//2+C//2
        y = A//2+C//2
        z = B//2+A//2
        A = x
        B = y
        C = z
        if A%2 != 0 or B %2 != 0 or C%2 != 0:
            print(i)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
import math

input = sys.stdin.readline

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


if A == B == C:
    print(-1)
else:
    for i in range(1,1000000):
        #print(A,B,C)
        #print(A/2+C/2,B/2+A/2,C/2+B/2)
        x = B/2+C/2
        y = A/2+C/2
        z = B/2+A/2
        A = x
        B = y
        C = z
        if A%2 != 0 or B %2 != 0 or C%2 != 0:
            print(i)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
import math

input = sys.stdin.readline

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


if A == B == C:
    print(-1)
else:
    for i in range(1,1000):
        #print(A,B,C)
        #print(A/2+C/2,B/2+A/2,C/2+B/2)
        x = B/2+C/2
        y = A/2+C/2
        z = B/2+A/2
        A = x
        B = y
        C = z
        if A%2 != 0 or B %2 != 0 or C%2 != 0:
            print(i)
            exit()

Submission status: Wrong Answer

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

total = a + b + c

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

Submission status: Wrong Answer

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

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

count = 0
while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
    _a = b / 2 + c /2
    _b = a / 2 + c /2
    _c = a / 2 + b /2
    a = _a
    b = _b
    c = _c
    count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(int, input().split()))
if A == B == C:
    print(-1)
    exit()
ans = 0
while True:
    if 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
    else:
        break
print(ans)

Submission status: Wrong Answer

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

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

count = 0
for i in range(10**9):
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    count += 1
    a = A
    b = B
    c = C
    A = b // 2 + c // 2
    B = a // 2 + c // 2
    C = a // 2 + b // 2

print(count)

Submission status: Wrong Answer

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

if A == B and B == C:
    print('-1')
    exit()

count = 0
for i in range(10**9):
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    count += 1
    a = A
    b = B
    c = C
    A = b // 2 + c // 2
    B = a // 2 + c // 2
    C = a // 2 + b // 2

print(count)

Submission status: Wrong Answer

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

if A == B and B == C:
    print('-1')
    exit()


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

count = 0
for i in range(10**9):
    print(A, B, C)
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    for j in range(10**9):
        count += 1
        a = A
        b = B
        c = C
        A = b // 2 + c // 2
        B = a // 2 + c // 2
        C = a // 2 + b // 2
        break

print(count)

Submission status: Wrong Answer

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

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


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

count = 0
for i in range(10**9):
    print(A, B, C)
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    for j in range(10**9):
        count += 1
        a = A
        b = B
        c = C
        A = b // 2 + c // 2
        B = a // 2 + c // 2
        C = a // 2 + b // 2
        break

print(count)

Submission status: Wrong Answer

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

if A == B and B == C:
    print('-1')
    exit()


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

count = 0
for i in range(10**9):
    m = max(A, B, C) - min(A, B, C)
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    for j in range(10**9):
        if (m % 2 == 0):
            m = m // 2
            count += 1
            a = A
            b = B
            c = C
            A = b // 2 + c // 2
            B = a // 2 + c // 2
            C = a // 2 + b // 2
            break

print(count)

Submission status: Wrong Answer

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

if A == B and B == C:
    print('-1')
    exit()


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

count = 0
m = max(A, B, C) - min(A, B, C)
for i in range(10**9):
    if (m % 2 == 0):
        m = m // 2
        count += 1
    if (str(m)[0] == '2'):
        break
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if A == B == C:
    print(-1)

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

Submission status: Wrong Answer

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

#print(A,B,C)

if A==B and B==C:
  print(-1)
else:
  count=0
  while A%2==0 and B%2==0 and C%2==0:
    Ax=A/2
    Bx=B/2
    Cx=C/2
    #print(Ax,Bx,Cx)
    A = int(Bx+Cx)
    B = int(Cx+Ax)
    C = int(Ax+Bx)
    count +=1
    #print(A,B,C)
  print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a == 1 and b == 1 and c == 1:
    print(0)
if a == b and b == c:
    print(-1)
    exit()
cnt = 0
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
    cnt += 1
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
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
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ABC014-A
abc = list(map(int,input().split()))

cnt = 0

while True:
    prev = abc[:]
    if abc[0] == 1 or abc[1] == 1 or abc[2] == 1:
        break
    tmp = [abc[0]//2,abc[1]//2,abc[2]//2]

    abc = [tmp[1]+tmp[2],tmp[0]+tmp[2],tmp[0]+tmp[1]]
    cnt += 1
    
    if abc[0] % 2 == 1 or abc[1] % 2 == 1 or abc[2] % 2 == 1:
        break
        
    elif abc[0] == prev[0] and abc[1] == prev[1] and abc[2] == prev[2]:
        cnt = -1
        break
    else:
        continue
        
    
        
print(cnt)