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:
def inpl(): return list(map(int, input().split()))
A, B, C = inpl()

if A == B == C:
    print(-1)
elif A%2 or B%2 or C%2:
    print(0)
else:
    S = A + B + C
    ans = 1
    while True:
        A, B, C = (C+B)//2, (A+C)//2, (A+B)//2
        if A%2 or B%2 or C%2 or S != (A+B+C):
            print(ans)
            break
        ans += 1

Submission status: Wrong Answer

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

if a == b and b == c:
  print(-1)
else:
  _a, _b, _c = a, b, c
  ai = 0
  while True:
    if _a % 2 == 0:
      _a //= 2
      ai += 1
    else:
      break
  bi = 0
  while True:
    if _b % 2 == 0:
      _b //= 2
      bi += 1
    else:
      break
  ci = 0
  while True:
    if _c % 2 == 0:
      _c //= 2
      ci += 1
    else:
      break
  min2 = min(ai, bi, ci)
  div2 = pow(2, min2)
  a //= div2
  b //= div2
  c //= div2
  if (a + b) % 2 == 0 and (a + c) % 2 == 0 and (c + b) % 2 == 0:
    min2 += 1
  print(min2)

Submission status: Wrong Answer

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

ans = 0
while 1:
    A,B,C = (B+C)//2, (A+C)//2, (A+B)//2
    ans += 1
    if A%2 or B%2 or C%2:
        break
print(ans)

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 and ans<100000:
    a,b,c=b//2+c//2,a//2+c//2,a//2+b//2
    ans+=1
if ans==10000:ans=-1
print(ans)

Submission status: Wrong Answer

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

ans = 0
while not(A%2 or B%2 or C%2):
    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())
if A==B==C:
    print(-1)
    exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
A=[a,b,c]
ans=0
if a%2==1 or b%2==1 or c%2==1:
  print(0)
  exit()
while a%2==0 and b%2==0 and c%2==0:
  a=(b+c)/2
  b=(sum(A)-A[1])/2
  c=(sum(A)-A[2])/2
  if [a,b,c]==A:
    print(-1)
    exit()
  ans+=1
  print([a,b,c])
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
A=[a,b,c]
ans=0
if a%2==1 or b%2==1 or c%2==1:
  print(0)
  exit()
while a%2==1 or b%2==1 or c%2==1:
  a=(b+c)/2
  b=(a+c)/2
  c=(a+b)/2
  if [a,b,c]==A:
    print(-1)
    exit()
  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)
else:
    s=a+b+c
    d=0
    j=0
    while a%2!=1 and b%2!=1 and c%2!=1:
        d+=1
        h=s
        j=a
        a=(s-a)//2
        b=j//2+c//2
        c=h-a-b
    print(d)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a%4!=0 and b%4!=0 and c%4!=0 or(a==b and b==c):
    print(-1)
else:
    s=a+b+c
    d=0
    j=0
    while a%2!=1 and b%2!=1 and c%2!=1:
        d+=1
        h=s
        j=a
        a=(s-a)//2
        b=j//2+c//2
        c=h-a-b
    print(d)

Submission status: Wrong Answer

Solution code:
def log_2(n):
    t = 0
    while n:
        if n % 2 == 1:
            break
        t += 1
        n //= 2
    return t


def solve(A, B, C)->int:

    s = A+B+C
    odd = log_2(s-C)
    even = log_2(s+A)

    if odd == even:
        return odd
    else:
        return odd+1


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

ans = 0
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    ans = 0
elif A == B == C:
    ans = -1
else:
    ans = solve(A, B, C)
print(ans)

Submission status: Wrong Answer

Solution code:
def log_2(n):
    t = 0
    while n:
        if n % 2 == 1:
            break
        t += 1
        n //= 2
    return t


def solve(A, B, C)->int:

    s = A+B+C
    odd = min(log_2(s-A), log_2(s-B), log_2(s-C))
    even = min(log_2(s+A), log_2(s+B), log_2(s+C))

    if odd == even:
        return odd
    else:
        return odd+1


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

ans = 0
if A == B == C:
    ans = -1
else:
    ans = solve(A, B, C)
print(ans)

Submission status: Wrong Answer

Solution code:
def log_2(n):
    t = 0
    while n:
        if n % 2 == 1:
            break
        t += 1
        n //= 2
    return t


def solve(A, B, C)->int:

    cnt = 1
    s = A+B+C
    odd = min(log_2(s-A), log_2(s-B), log_2(s-C))
    even = min(log_2(s+A), log_2(s+B), log_2(s+C))

    return min(odd, even)


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

ans = 0
if A == B == C:
    ans = -1
else:
    ans = solve(A, B, C)
print(ans)

Submission status: Wrong Answer

Solution code:
def log_2(n):
    t = 0
    while n:
        if n % 2 == 1:
            break
        t += 1
        n //= 2
    return t


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

diff = 0
if A != B and B != C and C != B:
    diff = min(abs(A-B), abs(B-C), abs(A-C))

ans = 0
if diff == 0:
    ans = -1
else:
    ans = log_2(diff)


print(ans)

Submission status: Wrong Answer

Solution code:
def log_2(n):
    t = 0
    while n:
        if n % 2 == 1:
            break
        t += 1
        n //= 2
    return t


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

diff = min(abs(A-B), abs(B-C), abs(C-A))

ans = 0
if diff == 0:
    ans = -1
else:
    ans = log_2(diff)


print(ans)

Submission status: Wrong Answer

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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B, C = MAP()

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

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

Submission status: Wrong Answer

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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B, C = MAP()

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

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

Submission status: Wrong Answer

Solution code:
import sys
a, b, c = map(int, input().split())
if a == b and b == c:
    print(-1)
    sys.exit(0)
count = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    tmpa = b // 2 + c // 2
    tmpb = a // 2 + c // 2
    tmpc = a // 2 + b // 2
    a = tmpa
    b = tmpb
    c = tmpc
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(int, input().split()))
if a%2 or b%2 or c%2:
    print("0")
aa = [a, (b+c)/2]
bb = [b, (c+a)/2]
cc = [c, (a+b)/2]
ans = []
for li in [aa,bb,cc]:
    DP = li
    if DP[0] == DP[1]:
        can = -1
        ans.append(can)
        continue
    can = 1
    while True:
        next = sum(DP)
        if next %2:
            break
        else:
            DP = [DP[0], next/2]
            can += 1
    ans.append(can)

hoge = -1
ans.sort()
for i in ans:
    if i > 0:
        hoge=i
        break
print(hoge)

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 == 1 or b % 2 == 1 or c % 2 == 1:
            print(count)
            break
        else:
            a,b,c = (b+c)//2,(a+c)//2,(a+b)//2
            count += 1

Submission status: Wrong Answer

Solution code:
def lma():return list(map(int, input().split()))#x or y
a = lma()
f = 1
c =0
while f:
    if (a[0] == a[1] and a[0] == a[2]) :
        c=-1
        break
    if a[0]%2==1 or a[1]%2==1 or a[2]%2 ==1:break
    a[0],a[1],a[2] = (a[1]+a[2])/2,(a[0]+a[2])/2,(a[1]+a[0])/2
    c+=1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a==b and b==c:
    print(-1)
else:
    f = 1
    ans = 0
    while 1:
        if a%2==1 or b%2==1 or c%2==1:
            break
        else:
            a2 = b//2 + c//2
            b2 = a//2 + c//2
            c2 = a//2 + b//2
            a = a2
            b = b2
            c = c2
            ans = 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)
else:
    f = 1
    ans = 0
    while 1:
        if a%2==1 or b%2==1 or c%2==1:
            break
        else:
            a2 = b//2 + c//2
            b2 = a//2 + b//2
            c2 = a//2 + c//2
            a = a2
            b = b2
            c = c2
            ans = 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()
else:
    t = True
    ans = 0
    while t:
        if a%2+b%2+c%2 > 0:
            print(ans)
            break
        else:
            ans += 1
            A = (b+c)//2
            B = (c+a)//2
            C = (a+b)//2
            a = A
            b = B
            c = C

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 + C) // 2, (C + A) // 2, (A + 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 B % 2 == 0:
        A, B, C = (B + C) // 2, (C + A) // 2, (A + B) // 2
        ans += 1

print(ans)

Submission status: Wrong Answer

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


def main():
    a, b, c = map(int, input().split())
    ans = 0

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

    for i in range(1, 31):
        twice = 2 ** i
        tmp = twice % 3

        x = twice // 3
        y = x
        z = x

        if tmp == 2:
            y += 1
            z += 1
        elif tmp == 1:
            x += 1

        takahashi = a * x + b * y + c * z
        aoki = a * y + b * x + c * z
        snuke = a * z + b * y + c * x

        if takahashi % twice == 0 and aoki % twice == 0 and snuke % twice == 0:
            ans += 1
        else:
            print(ans)
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def main():
    a, b, c = map(int, input().split())
    ans = 0

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

    for i in range(1, 31):
        twice = 2 ** i
        tmp = twice % 3

        x = twice // 3
        y = x
        z = x

        if tmp == 2:
            y += 1
            z += 1
        elif tmp == 1:
            x += 1

        takahashi = a * x + b * y + c * z
        aoki = a * y + b * x + c * z
        snuke = a * z + b * y + c * x

        if takahashi % twice == 0 and aoki % twice == 0 and snuke % twice == 0:
            ans += 1
        else:
            print(ans)
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def main():
    a, b, c = map(int, input().split())
    ans = 0

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

    for i in range(1, 33):
        twice = 2 ** i
        tmp = twice % 3

        x = twice // 3
        y = x
        z = x

        if tmp == 2:
            y += 1
            z += 1
        elif tmp == 1:
            x += 1

        takahashi = a * x + b * y + c * z
        aoki = a * y + b * x + c * z
        snuke = a * z + b * y + c * x

        if takahashi % twice == 0 and aoki % twice == 0 and snuke % twice == 0:
            ans += 1
        else:
            print(ans)
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

t = 0
while t < 30:
    t += 1
    a = list(int((sum(a) - x) / 2) for x in a)
    if sum(1 for x in a if x % 2 == 1) > 0:
        break
else:
    t = -1

print(t)

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys

input = sys.stdin.readline


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


A, B, C = inpl()

ans = 0
if A == B == C:
    ans = -1
else:
    while not (A % 2 or B % 2 or C % 2):
        ha, hb, hc = A // 2, B // 2, C // 2
        A, B, C = hb + hc, ha + hc, ha + hb
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
def operate(a,b,c,t):
    if not (a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
        return t
    (a,b,c) = (b//2 + c//2,c//2 + a//2,a//2 + b//2)
    return operate(a,b,c,t+1)
if A == B == C:
    ans = -1
else:
    ans = operate(A,B,C,0)
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
def operate(a,b,c,t):
    if not (a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
        return t
    (a,b,c) = (b//2 + c //2,c //2 + a//2,a//2 + b//2)
    return operate(a,b,c,t+1)
if A == B == C:
    ans = -1
else:
    ans = operate(A,B,C,0)
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:
    x=a
    y=b
    z=c
    a=(y+z)//2
    b=(x+z)//2
    c=(x+y)//2
    count+=1
  print(count)

Submission status: Wrong Answer

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

cnt = 0
for _ in range(int(1e5)):
    cnt += 1
    aa = (b+c)//2
    bb = (a+c)//2
    cc = (a+b)//2
    if aa%2==1 or bb%2==1 or cc%2==1:
        print(cnt)
        break
    a = aa
    b = bb
    c = cc
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B, C = [int(_) for _ in input().split()]
if [A - B, A - C] == [0, 0]:
    print(-1)
    exit()
i = 0
while not any([A % 2, B % 2, C % 2]):
    A, B, C = (B + C) / 2, (C + A) / 2, (A + B) / 2
    i += 1
print(i)

Submission status: Wrong Answer

Solution code:
A, B, C = [int(_) for _ in input().split()]
if [A - B, A - C] == [0, 0] or any([A % 2, B % 2, C % 2]):
    print(-1)
    exit()
i = 0
while not any([(B + C) % 2, (C + A) % 2, (A + B) % 2]):
    A, B, C = (B + C) / 2, (C + A) / 2, (A + B) / 2
    i += 1
print(i)

Submission status: Wrong Answer

Solution code:
A, B, C = [int(_) for _ in input().split()]
if [A - B, A - C] == [0, 0]:
    print(-1)
    exit()
i = 0
while not any([(B + C) % 2, (C + A) % 2, (A + B) % 2]):
    A, B, C = (B + C) / 2, (C + A) / 2, (A + B) / 2
    i += 1
print(i)

Submission status: Wrong Answer

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

def f(a, b, c, count):
    if a // 2 % 2 == 1 and b // 2 % 2 == 1 and c // 2 % 2 == 1:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    elif a // 2 % 2 == 0 and b // 2 % 2 == 0 and c // 2 % 2 == 0:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    else:
        return count

if a == b and b == c:
    print(-1)
else:
    print(f(a, b, c, 0))

Submission status: Wrong Answer

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

def f(a, b, c, count):
    if a % 2 == 1 and b % 2 == 1 and c % 2 == 1:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    else:
        return count

if a == b and b == c:
    print(-1)
else:
    print(f(a, b, c, 0))

Submission status: Wrong Answer

Solution code:
l=[int(i) for i in input().split()]
chk=[0]*3
ans=0
st=10000
while st:
    st-=1
    for i in range(3):
        for j in l:
            if j%2:
                print(ans)
                exit()
        tmp=0
        for j in l:
            tmp+=int(bin(j)[-2])
        if tmp==3:
            print(-1)
            exit()
        chk[i]=l[(i+1)%3]//2+l[(i+2)%3]//2
    l=[i for i in chk]
    chk=[0]*3
    ans+=1

Submission status: Wrong Answer

Solution code:
l=[int(i) for i in input().split()]
chk=[0]*3
ans=0
st=100
while st:
    st-=1
    for i in range(3):
        for j in l:
            if j%2:
                print(ans)
                exit()
        tmp=0
        for j in l:
            tmp+=int(bin(j)[-2])
        if tmp==3:
            print(-1)
            exit()
        chk[i]=l[(i+1)%3]//2+l[(i+2)%3]//2
    l=[i for i in chk]
    chk=[0]*3
    ans+=1

Submission status: Wrong Answer

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

if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    for i in range(1,10**5):
        a2 = (b+c)//2
        b2 = (a+c)//2
        c2 = (a+b)//2
        a = a2
        b = b2
        c = c2
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            res = 0
        else:
            res = i
            print(res)
            break
    print(-1)
else:
    print(0)

Submission status: Wrong Answer

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

if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    for i in range(1,10**5):
        a2 = (b+c)//2
        b2 = (a+c)//2
        c2 = (a+b)//2
        a = a2
        b = b2
        c = c2
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            res = 0
        else:
            res = i
            print(res)
            break
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
if a[0]==a[1] and a[1]==a[2]:
    print('-1')
    exit()
ans = 0
while a[0]%2==0 and a[1]%2==0 and a[2]%2==0:
    ans += 1
    b = []
    d = a[0]//2
    e = a[1]//2
    f = a[2]//2
    x = e + f
    y = d + f
    z = d + e
    b.append(x)
    b.append(y)
    b.append(z)
    a = b
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int, input().split())
d=0
while d<10**5:
    a,b,c=b/2+c/2,a/2+c/2,a/2+b/2
    d+=1
    if a%2==1 or b%2==1 or c%2==1:break
else:d=-1
print(d)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int, input().split())
d=0
while d<10**4:
    a,b,c=b/2+c/2,a/2+c/2,a/2+b/2
    d+=1
    if a%2==1 or b%2==1 or c%2==1:break
else:d=-1
print(d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def abc(a, b, c):
    ans = 0
    while a%2 + b%2 + c%2==0:
        ans += 1
        x, y, z = a, b, c
        a = (y+z)//2
        b = (z+x)//2
        c = (x+y)//2
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def abc(a, b, c):
    ans = 0
    v = a%2 + b%2 + c%2
    while a%2 + b%2 + c%2==0:
        ans += 1
        x, y, z = a, b, c
        a = (y+z)/2
        b = (z+x)/2
        c = (x+y)/2
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def abc(a, b, c):
    ans = -1
    v = a%2 + b%2 + c%2
    while v==0:
        ans += 1
        v = a%2 + b%2 + c%2
        x, y, z = a, b, c
        a = (y+z)/2
        b = (z+x)/2
        c = (x+y)/2
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def abc(a, b, c):
    ans = -1
    v = a%2 + b%2 + c%2
    while v==0:
        ans += 1
        v = a%2 + b%2 + c%2
        x, y, z = a, b, c
        a = (y+z)/2
        b = (z+x)/2
        c = (x+y)/2
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))

Submission status: Wrong Answer

Solution code:
def abc(a, b, c):
    ans = -1
    v = a%2 + b%2 + c%2
    while v==0:
        ans += 1
        v = a%2 + b%2 + c%2
        x, y, z = a, b, c
        a = y/2 + z/2
        b = z/2 + x/2
        c = x/2 + y/2
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def abc(a, b, c):
    ans = -1
    v = a%2 + b%2 + c%2
    while v==0:
        ans += 1
        v = a%2 + b%2 + c%2
        x, y, z = a, b, c
        a = y//2 + z//2
        b = z//2 + x//2
        c = x//2 + y//2
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def abc(a, b, c):
    ans = -1
    v = a%2 + b%2 + c%2
    while v==0:
        ans += 1
        v = a%2 + b%2 + c%2
        x, y, z = a, b, c
        a = y//2 + z//2
        b = z//2 + x//2
        c = x//2 + y//2
        print('{} {} {}'.format(a, b, c))
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
ans = 0
while True:
    if len(set(a)) == 1:
        print(-1)
        exit()
    ans += 1
    t = tuple(a)
    a[0] = (t[1] + t[2])//2
    a[1] = (t[0] + t[2])//2
    a[2] = (t[0] + t[1])//2
    for i in range(3):
        if a[i] % 2:
            print(ans)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
cou = 0
while True:
  if a == b == c:
    print("-1")
    exit()
  if a % 2 or b % 2 or c % 2:
    print(cou)
    exit()
  co_a = b//2 + c//2
  co_b = a//2 + c//2
  co_c = a//2 + b//2
  a = co_a
  b = co_b
  c = co_c
  cou += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
        if A==B and C==A:
            times = -1
            break
        elif A<=1 or B<=1 or C<=1:
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        
        

print(times)

Submission status: Wrong Answer

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

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
        if A==B and C==A:
            times = -1
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        elif A<=1 or B<=1 or C<=1:
            break
        

print(times)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from itertools import count
a,b,c=map(int,input().split())

for i in count(1):
  a,b,c=(b+c)/2,(a+c)/2,(a+b)/2
  if a==b==c:
    print(-1)
    break
  elif a%2 or b%2 or c%2:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
A, B, C = [int(_) for _ in input().split()]
 
def solve(A, B, C):
    result = 0
    if A == B == C and A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
        return -1
    while 1:
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            return result
        A, B, C = A/2+B/2, B/2+C/2, C/2+A/2
        result += 1

print(solve(A, B, C))

Submission status: Wrong Answer

Solution code:
A, B, C = [int(_) for _ in input().split()]
 
def solve(A, B, C):
    result = 0
    if A == B == C:
        return -1
    while 1:
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            return result
        A, B, C = A/2+B/2, B/2+C/2, C/2+A/2
        result += 1

print(solve(A, B, C))

Submission status: Wrong Answer

Solution code:
A, B, C = [int(_) for _ in input().split()]
 
def solve(A, B, C):
    if A == B == C:
        return -1
    result = 0
    while 1:
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            return result
        A, B, C = A/2+B/2, B/2+C/2, C/2+A/2
        result += 1

print(solve(A, B, C))

Submission status: Wrong Answer

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

if a == b and b == c :
	print -1

else : 
	count = 0
	while True:
		if a % 2 == 1 or b%2 == 1 or c%2 ==1:
			print count 
			break
		else :
			a_tmp = b/2 + c/2
			b_tmp = a/2 + c/2
			c_tmp = a/2 + b/2
			a = a_tmp
			b = b_tmp
			c = c_tmp
			count += 1