Problem:
 Score : 300 points    Problem Statement Takahashi, Aoki and Snuke love cookies. They have A , B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:   Each person simultaneously divides his cookies in half and gives one half to each of the other two persons.   This action will be repeated until there is a person with odd number of cookies in hand.  How many times will they repeat this action?
Note that the answer may not be finite.      Constraints  1 ≤ A,B,C ≤ 10^9         Input Input is given from Standard Input in the following format:  A  B  C       Output Print the number of times the action will be performed by the three people, if this number is finite.
If it is infinite, print -1 instead.        Sample Input 1 4 12 20      Sample Output 1 3  Initially, Takahashi, Aoki and Snuke have 4 , 12 and 20 cookies. Then,   After the first action, they have 16 , 12 and 8 .  After the second action, they have 10 , 12 and 14 .  After the third action, they have 13 , 12 and 11 .   Now, Takahashi and Snuke have odd number of cookies, and therefore the answer is 3 .       Sample Input 2 14 14 14      Sample Output 2 -1       Sample Input 3 454 414 444      Sample Output 3 1

Solution (Python):




from __future__ import division, print_function 

import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io


"""Uncomment modules according to your need"""













if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip



"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""Uncomment next 4 lines if doing huge recursion"""




def prepare_factorial(mod=mod):
    """ returns two lists, factorial and inverse factorial modulo argument by default 10**9 +7 """
    
    fact = [1]
    for i in range(1, 200005):
        fact.append((fact[-1] * i) % mod)

    ifact = [0] * 200005
    ifact[200004] = pow(fact[200004], mod - 2, mod)
    for i in range(200004, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod

    return fact, ifact

def modinv(n, p):
    """ returns N inverse modulo p """
    return pow(n, p - 2, p)

def ncr(n, r,  fact, ifact):
    """ takes 4 arguments: n , r and factorial and inverse factorial lists"""
    t = (fact[n] * (ifact[r]*ifact[n-r]) % MOD)% MOD
    return t


def get_n(Sum):    
    """this function returns the maximum n for which Summation(n) <= Sum"""
    ans = (-1 + sqrt(1 + 8*Sum))//2
    return ans

def sieve(n):
    """ returns a list of prime numbers till n """
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r



def divs(n, start=1):
    """ returns a list of all divisors till n """
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors



def divn(n, primes):
    """ returns the number of divisors, two arguments n and the sieve till n """
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t



def lrfind(d, x, default=-1):
    """ Takes 2 arguments an iterable and an element. returns a tuple (firstoccurence,lastoccurence) -1 if not found """
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return default, default
    else:
        return left, right

def gcd(x, y): 
    """ returns greatest common divisor of x and y """
    while y:
        x, y = y, x % y
    return x

def check_sorted(a):
    ''' returns True/False '''
    for i in range(len(a)-1):
        if a[i]>a[i+1]:
            return False
    return True
def ceil(n, k=1): return n // k + (n % k != 0) 
def input(): return sys.stdin.readline().strip()
def ii(): return int(input()) 
def mi(): return map(int, input().split()) 
def li(): return list(map(int, input().split())) 
def lw(): return input().split() 
def lcm(a, b): return abs(a * b) // gcd(a, b) 
def prr(a, sep=' ', end='\n'): print(sep.join(map(str, a)), end=end) 
def dd(): return defaultdict(int) 
def ddl(): return defaultdict(list) 
def write(s): return sys.stdout.write(s)













def main():
    
    a,b,c=mi()
    s=a+b+c
    steps=0
    if a%2==1 or b%2==1 or c%2==1:
        print(steps)
        return
    if(a==b and b==c):
        print(-1)
        return
    while True:
        a=(s-a)//2
        b=(s-b)//2
        c=(s-c)//2
        steps+=1
        if a%2==1 or b%2==1 or c%2==1:
            print(steps)
            break
        if(a==b and b==c):
            print(-1)
            break





""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)


class IOWrapper(IOBase):

    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')



""" main function"""

if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
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
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


A, B, C = MAP()

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

ans = 0
while all(x%2 == 0 for x in [A, B, C]):
	A, B, C = (B+C)//2, (A+C)//2, (A+B)//2
	ans += 1

print(ans)

Solution (Python):
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
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


A, B, C = MAP()

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

cnt = 0
while 1:
	a = (B+C)/2
	b = (A+C)/2
	c = (A+B)/2
	cnt += 1
	if any(x%2 for x in [a, b, c]):
		print(cnt)
		break
	else:
		A, B, C = a, b, c

Solution (Python):
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
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


A, B, C = MAP()

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

l = [(A, B, C)]

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

Solution (Python):
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
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


A, B, C = MAP()

if any(x%2 != 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

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

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

counter = 0
while a%2==b%2==c%2==0:
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    counter += 1
    if counter > 100000:
        counter = -1
        break
print(counter)

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

counter = 0
while a%2==b%2==c%2==0:
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    counter += 1
    if counter > 26:
        counter = -1
        break
print(counter)

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

counter = 0
while a%2==b%2==c%2==0:
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    counter += 1
    if counter > 31:
        counter = -1
        break
print(counter)

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

counter = 0
while a%2==b%2==c%2==0:
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    counter += 1
    if counter > 1000:
        counter = -1
        break
print(counter)

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

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

print(-1)

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

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

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

    if A == B == C:
        c = -1
        break

print(c)

Solution (Python):


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

    print(cnt)

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

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

ans = 0

while True:
    if A%2!=0 or B%2!=0 or C%2!=0:
        print(ans)
        break
    elif A%2==0 and B%2==0 and C%2==0 and A == B == C:
        print('-1')
        break
    A_ = A/2
    B_ = B/2
    C_ = C/2
    A = B_+C_
    B = A_+C_
    C = A_+B_
    ans += 1

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

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

while a%2 == 0 and b%2 == 0 and c%2 == 0:
    ans += 1

    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    
    a = x
    b = y
    c = z

print(ans)

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

if A == B == C and A%2==0:
    print(-1)
else:
    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
    print(cnt)

Solution (Python):
import math

import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit


ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    a,b,c = map(int,ipt().split())
    for i in range(10**18):
        if a%2 == 1 or b%2 == 1 or c%2 == 1:
            print(i)
            exit()
        elif a == b == c:
            print(-1)
            exit()
        pa = a
        pb = b
        pc = c
        a = (pb+pc)//2
        b = (pa+pc)//2
        c = (pa+pb)//2
    return

if __name__ == '__main__':
    main()

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count




A,B,C = IL()

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

count = 0
while max(A,B,C)-min(A,B,C) > 0:
  if not(A%2 == B%2 == C%2 == 0):
    break
  A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
  count += 1
  

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

Solution (Python):
a, b, c = [int(i) for i in input().split()]
if a == b == c and a % 2 == 0:
    print(-1)
    exit()
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print(0)
    exit()
cnt = 0
while True:
    ta, tb, tc = a, b, c
    ta = (b + c) // 2
    tb = (a + c) // 2
    tc = (a + b) // 2
    cnt += 1
    if ta % 2 == 1 or tb % 2 == 1 or tc % 2 == 1:
        print(cnt)
        break
    a, b, c = ta, tb ,tc

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

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

count = 0

for _ in range(1000000):
    
    _a, _am = divmod(a, 2)
    _b, _bm = divmod(b, 2)
    _c, _cm = divmod(c, 2)

    if _am or _bm or _cm:
        print(count)
        break
    elif a == b == c:
        print(-1)
        break
    else:
        a = _b + _c
        b = _a + _c
        c = _a + _b
        count += 1
else:
    print(-1)

Solution (Python):
def main():
    from builtins import int, map, list, print, sorted
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    A, B, C = sorted(input_number_list())
    ans = 0
    isOK = True
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        a = A / 2
        b = B / 2
        c = C / 2
        tA = b + c
        tB = a + c
        tC = a + b
        tA, tB, tC = sorted([tA, tB, tC])
        if tA == A and tB == B and tC == C:
            isOK = False
            break
        A = tA
        B = tB
        C = tC
        ans += 1
    print([-1, ans][isOK])


if __name__ == '__main__':
    main()

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

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

cnt = 0

while True:
    if a % 2 == 1:
        print(cnt)
        exit()
    if b % 2 == 1:
        print(cnt)
        exit()
    if c % 2 == 1:
        print(cnt)
        exit()
    if a == b and a == c:
        print(-1)
        exit()
    lis = []
    lis.append((b+c)/2)
    lis.append((a+c)/2)
    lis.append((a+b)/2)
    a, b, c = lis

    cnt += 1

Solution (Python):
a,b,c = map(int,input().split())
for i in range(600):
  if a&1 or b&1 or c&1:
    break
  a,b,c = a//2, b//2, c//2
  a, b, c = b + c, a + c, a + b
ans = i if i < 500 else -1
print(ans)

Solution (Python):


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

ans = 0
while True:
    if A%2 or B%2 or C%2:
        break
    if A == B == C:
        ans = -1
        break
    nA = B//2 + C//2
    nB = A//2 + C//2
    nC = A//2 + B//2
    A = nA
    B = nB
    C = nC
    ans += 1

print(ans)

Solution (Python):
a,b,c=map(int,input().split())
num1=0
num2=0
num3=0
if a==b and b==c and a%2==0:
    print(-1)
else:
    for i in range(a*b*c):
        if a%2==1 or b%2==1 or c%2==1:
            break
        num1=a//2
        num2=b//2
        num3=c//2
        a=num2+num3
        b=num3+num1
        c=num1+num2
    print(i)

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

cnt=0
lp=0
ls=set()
a=A
b=B
c=C
ls.add((a,b,c))
while not(a%2==1 or b%2==1 or c%2==1 or lp==1):
    a=int((A+B+C-a)/2)
    b=int((A+B+C-b)/2)
    c=int((A+B+C-c)/2)
    cnt+=1
    if ((a,b,c) in ls):
        lp=1
if lp==1:
    print(-1)
else:
    print(cnt)

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

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

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

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

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

    return


resolve()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    cnt = 0
    while True:
        if cnt > 10 ** 5:
            print(-1)
            return

        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            print(cnt)
            return

        A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2
        cnt += 1
       

if __name__ == '__main__':
    main()

Solution (Python):


import sys
sys.setrecursionlimit(10**6)

def solve(a,b,c,counter=0):
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        return counter
    elif a == b == c: 
        return -1
    else:
        return solve((b+c)//2,(c+a)//2,(a+b)//2,counter+1)


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

if __name__ == '__main__':
    main()

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

def f(a, b, c):
    if a%2==1 or b%2==1 or c%2==1:
        return 0
    if a==b==c:
        return -1
    return f((b+c)/2, (c+a)/2, (a+b)/2)+1
ans = f(a, b, c)
print(ans)

Solution (Python):
abc = list(map(int,input().split()))
lis=[abc]
ans=0
def ch(x):
  for i in x:
    if i%2==1:
      return -1
  return 1
def sw(x):
  ret=[]
  ret.append(x[2]/2+x[1]/2)
  ret.append(x[0]/2+x[2]/2)
  ret.append(x[0]/2+x[1]/2)
  return ret
def check(a,l):
  for x in l:
    if a==x:
      return 1
  return 0
while True:
  if ch(abc)==-1:
    break
  abc=sw(abc)
  if check(abc,lis):
    ans=-1
    break
  lis.append(abc)
  ans+=1
  
print(ans)

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

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

cnt = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    cnt += 1
    aa = b // 2 + c // 2
    bb = c // 2 + a // 2
    cc = a // 2 + b // 2
    a = aa
    b = bb
    c = cc
print(cnt)

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

Solution (Python):
a,b,c=map(int,input().split())
d=0
while(all([a%2==0,b%2==0,c%2==0])):
  x=b//2+c//2
  y=c//2+a//2
  z=a//2+b//2
  d+=1
  a=x
  b=y
  c=z
  if a==b==c:
    d=-1
    break
print(d)

Solution (Python):
A,B,C = map(int, input().split())
cnt = 0
if A%2 or B%2 or C%2:
    print(cnt)
    exit()
if A == B and B == C:
    print(-1)
    exit()
while True:
    if A%2 or B%2 or C%2:
        print(cnt)
        break
    temp_a = A//2
    temp_b = B//2
    temp_c = C//2
    A += 2*temp_a + temp_b + temp_c
    B += 2*temp_b + temp_a + temp_c
    C += 2*temp_c + temp_a + temp_b
    cnt += 1

Solution (Python):
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

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

i = 0
while True:
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i)
        break
    elif a == b == c:
        print(-1)
        break
    a_h = a / 2
    b_h = b / 2
    c_h = c / 2
    a = b_h + c_h
    b = a_h + c_h
    c = a_h + b_h
    i += 1

Solution (Python):
a,b,c=map(int,input().split())
temp=1000
i=0
while i<temp:
  if a%2!=0 or b%2!=0 or c%2!=0:
    print(i)
    break
  else:
    at=a
    bt=b
    ct=c
    a=bt//2+ct//2
    b=at//2+ct//2
    c=at//2+bt//2
    i=i+1
else:
  print(-1)

Solution (Python):

import sys


def solve(A: int, B: int, C: int):
    ans = 0
    already = set()
    already.add((A, B, C))
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        tmp_a = B // 2 + C // 2
        tmp_b = A // 2 + C // 2
        tmp_c = B // 2 + A // 2
        A = tmp_a
        B = tmp_b
        C = tmp_c
        ans += 1

        res = (A, B, C)
        if res in already:
            ans = -1
            break
        already.add(res)

    ans = ans if ans else 0
    print(ans)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    solve(A, B, C)


if __name__ == "__main__":
    main()

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

count = 0
while (A % 2, B % 2, C % 2) == (0, 0, 0):
    A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2
    count += 1

print(count)

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

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

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

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

ans = 0

while True:
    if ans > 999999:
        print(-1)
        break
    elif 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

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

ans = 0

while True:
    if ans > 999999:
        print(-1)
        break
    elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        print(ans)
        break
    n_a = b/2 + c/2
    n_b = a/2 + c/2    
    n_c = a/2 + b/2
    a = n_a
    b = n_b
    c = n_c
    ans += 1

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

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

Solution (Python):
a,b,c = map(int,input().split())
cnt = 0
def f(a,b,c):
	return b//2 + c//2, a//2 + c//2, a//2 + b//2

while (a%2==0 and b%2==0 and c%2==0):
	if a==b and b==c and c==a:
		print('-1')
		exit()
	else:
		cnt += 1
		a,b,c = f(a,b,c)
print(cnt)

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