qyliang/CodeNanoFix huggingface dataset:
Buggy code:
def solve(a, b, c):
    if (a, b, c) in s:
        return -1
    if (a % 2) or (b % 2) or (c % 2):
        return 0
    a >>= 1
    b >>= 1
    c >>= 1
    return 1 + solve(b + c , c + a, a + b)

if __name__ == '__main__':
    a, b, c = map(int, input().split())
    s = set()
    print(solve(a, b, c))



Fixed code:
def solve(a, b, c, ans):
    if (a, b, c) in s:
        return -1
    if (a % 2) or (b % 2) or (c % 2):
        return ans
    s.add((a, b, c))
    a >>= 1
    b >>= 1
    c >>= 1
    return solve(b + c , c + a, a + b, ans + 1)

if __name__ == '__main__':
    a, b, c = map(int, input().split())
    s = set()
    print(solve(a, b, c, 0))
Buggy code:
cookie = list(map(int, input().split()))

cookie.sort()

l = cookie[0]
r = cookie[2]
if l == r:
    print(-1)

count = 0
while cookie[2] - cookie[0] > 0:
    if cookie[0] % 2 == 1 or cookie[1] % 2 == 1 or cookie[2] % 2 == 1:
        print(count)
        exit()
    if cookie[0] == cookie[2]:
        print(-1)
        exit()
    count += 1
    a = (cookie[1] + cookie[2]) // 2
    b = (cookie[2] + cookie[0]) // 2
    c = (cookie[0] + cookie[1]) // 2
    cookie[0] = a
    cookie[1] = b
    cookie[2] = c
    cookie.sort()

print(count)

Fixed code:
cookie = list(map(int, input().split()))

cookie.sort()

count = 0
if cookie[0] == cookie[2] and cookie[0] % 2 == 0:
    print(-1)
    exit()
    
while cookie[2] - cookie[0] > 0:
    if cookie[0] % 2 == 1 or cookie[1] % 2 == 1 or cookie[2] % 2 == 1:
        print(count)
        exit()
    if cookie[0] == cookie[2]:
        print(-1)
        exit()
    count += 1
    a = (cookie[1] + cookie[2]) // 2
    b = (cookie[2] + cookie[0]) // 2
    c = (cookie[0] + cookie[1]) // 2
    cookie[0] = a
    cookie[1] = b
    cookie[2] = c
    cookie.sort()

print(count)
Buggy 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)

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

Fixed code:
a,b,c = map(int, input().split())
d,e,f = abs(b-a),abs(c-b),abs(a-c)
ans = 0
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
  print(0)
else: 
  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)
Buggy code:
a,b,c = map(int,input().split())

count = 0
while True:
    if a%2==1 or b%2==1 or c%2==1 :
        break
    else:
        x = b//2 + c//2
        y = a//2 + c//2
        z = a//2 + b//2
        a = x
        b = y
        c = z   
        if a==b and b==c:
            print(-1)
            break
        count += 1
print(count)

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

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

def f(a, b, c, count):
    if 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 and a % 2 == 0:
    print(-1)
else:
    print(f(a, b, c, 0))
Buggy 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)

Fixed 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
        if i == 10**5-1:
            print(-1)
else:
    print(0)
Buggy code:
A,B,C = map(int,input().split())
ans = 0
if A == B == C and A%2 == 0 or B%2 == 0 or C%2 == 0:
  ans = -1
else:
  while A%2 == 0 and B%2 == 0 and C%2 == 0:
    if A == B == C:
      ans = -1
      break
    A,B,C = B//2+C//2,A//2+C//2,A//2+B//2
    ans += 1
print(ans)

Fixed code:
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 == 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)
Buggy code:
A,B,C = map(int,input().split())
ans = None

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)


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

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

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


Fixed code:
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:
        ans = -1
        break
    ans += 1
    a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
print(ans)
Buggy 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))


Fixed code:
A, B, C = [int(_) for _ in input().split()]
 
def solve(A, B, C):
    result = 0
    if A == B == C and A % 2 == 0 and B % 2 == 0 and 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))
Buggy code:
a, b, c = map(int, input().split())
if a == b == c:
    if a & 1:
        print(0)
    else:
        print(-1)
    exit()

count = 0
while True:
    if (a | b | c) & 1:
        break
    half_a = a // 2
    half_b = b // 2
    half_c = c // 2
    a = half_b + half_c
    b = half_a + half_c
    c = half_a + half_b
    count += 1
print(count)

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

count = 0
while True:
    if (a | b | c) & 1:
        break
    half_a = a // 2
    half_b = b // 2
    half_c = c // 2
    a = half_b + half_c
    b = half_a + half_c
    c = half_a + half_b
    count += 1
print(count)



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

count = 0
while True:
    if (a | b | c) & 1:
        break
    half_a = a // 2
    half_b = b // 2
    half_c = c // 2
    a = half_b + half_c
    b = half_a + half_c
    c = half_a + half_b
    count += 1
print(count)
Buggy code:
a, b, c = map(int, input().split())

if a == b == c:
	if a % 2 == 1:
		print(1)
	else:
		print(0)

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

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

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

else:
	ans = 0
	while not (a % 2 == 1 or b % 2 == 1 or c % 2 == 1):
		ans += 1
		a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
	print(ans)
Buggy code:
a,b,c=map(int,input().split())

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

Fixed code:
a,b,c=map(int,input().split())
cnt=0
if a%2==1 or b%2==1 or c%2==1:
    print(0)
    exit()
elif a==b==c:
    print(-1)
    exit()
else:
    while a%2==0 and b%2==0 and c%2==0:
        a,b,c=b//2+c//2,a//2+c//2,a//2+b//2
        cnt+=1
print(cnt)
Buggy code:
a, b, c = map(int,input().split())
ans = 0
if a == b == c:
  print(-1)
  exit()
else:
  while True:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
      ans += 1
      a = a // 2
      b = b // 2
      c = c // 2
    else:
      break

print(ans)

Fixed code:
a, b, c = map(int,input().split())
ans = 0
if a == b == c:
  if a % 2 == 0:
    print(-1)
  else:
    print(0)
  exit()
else:
  while True:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
      ans += 1
      p = a // 2
      q = b // 2
      r = c // 2
      a = q + r
      b = r + p
      c = p + q
    else:
      break

print(ans)
Buggy code:
A, B, C = map(int, input().split())

gokei = A + B + C
ans = 0

if A == B == C:
    print(-1)
else:
    while all(map(lambda x: x % 2 == 0, (A, B, C))):
        A = (gokei - A) / 2
        B = (gokei - B) / 2
        C = (gokei - C) / 2
        ans += 1

print(ans)

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

gokei = A + B + C
ans = 0

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

if A == B == C and all(lambda x: x%2==0, [A, B, C]):
    print(-1)
else:
    ans = 0
    cookie = A+B+C
    while True:
        if all(map(lambda x: x%2==0, [A, B, C])):
            ans += 1
        else:
            print(ans)
            break
        A = (cookie-A) / 2
        B = (cookie-B) / 2
        C = (cookie-C) / 2

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

if A == B == C and all(map(lambda x: x%2==0, [A, B, C])):
    print(-1)
else:
    ans = 0
    cookie = A+B+C
    while True:
        if all(map(lambda x: x%2==0, [A, B, C])):
            ans += 1
        else:
            print(ans)
            break
        A = (cookie-A) / 2
        B = (cookie-B) / 2
        C = (cookie-C) / 2
Buggy code:
a,b,c=map(int,input().split())
if a==b==c:
  print(-1)
else:
  c=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
    c+=1
  print(c)

Fixed code:
a, b, c = sorted(map(int, input().split()))
if a % 2 == 0 and a == b and b == c:
    print(-1)
else:
    cnt = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        cnt = cnt + 1
        a, b, c = (b + c) //2, (a + c) // 2, (a + b) //2
    print(cnt)
Buggy code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print("0")
while a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a == b and a == c:
    print("-1")
else:
    print(cnt)

Fixed code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == 1 and b == 1 and c == 1:
        break
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a  == 1 and b == 1 and c == 1: 
        print("0")
elif a == b and a == c:
    print("-1")
else:
    print(cnt)
Buggy code:
# coding: utf-8

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

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

print(count)

Fixed code:
# coding: utf-8

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

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

    a = A
    b = B
    c = C
    i = 0
    while True:
        if (b + c) % 2 > 0 or (a + c) % 2 > 0 or (a + b) % 2 > 0:
            break
        elif A == B == C:
            i = -1
        else:
            now_a = (b + c) / 2
            now_b = (a + c) / 2
            now_c = (a + b) / 2
            a = now_a
            b = now_b
            c = now_c
            i += 1
    print(i)

main()


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

    a = A
    b = B
    c = C
    i = 0
    while True:
        if a % 2 > 0 or b % 2 > 0 or c % 2 > 0:
            break
        elif A == B == C:
            i = -1
            break
        else:
            now_a = (b + c) / 2
            now_b = (a + c) / 2
            now_c = (a + b) / 2
            a = now_a
            b = now_b
            c = now_c
            i += 1
    print(i)

main()
Buggy code:
A, B, C = map(int, input().split())
L = [A, B, C]


def check(n):
    x = 2 ** n
    y = x // 3
    if y % 3 == 1:
        for i in range(3):
            adds = [y] * 3
            adds[i] += 1
            tmp = (A * adds[0] + B * adds[1] + C * adds[2]) / x
            if int(tmp) != tmp:
                return False
    else:
        for i in range(3):
            adds = [y] * 3
            adds[i] += 1
            adds[(i + 1) % 3] += 1
            tmp = (A * adds[0] + B * adds[1] + C * adds[2]) / x
            if int(tmp) != tmp:
                return False
    return True


for i in range(1, 1000):
    if not check(i):
        print(i - 1)
        exit()
print(-1)


Fixed code:
A, B, C = map(int, input().split())
L = [A, B, C]

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


def check(n):
    x = 2 ** n
    y = x // 3
    if x % 3 == 1:
        for i in range(3):
            adds = [y] * 3
            adds[i] += 1
            tmp = (A * adds[0] + B * adds[1] + C * adds[2]) / x
            if int(tmp) != tmp:
                return False
    else:
        for i in range(3):
            adds = [y] * 3
            adds[i] += 1
            adds[(i + 1) % 3] += 1
            tmp = (A * adds[0] + B * adds[1] + C * adds[2]) / x
            if int(tmp) != tmp:
                return False
    return True


for i in range(1, 1000):
    if not check(i):
        print(i - 1)
        exit()
print(-1)
Buggy code:
A, B, C = list(map(int, input().split()))

pattern = list()
i = 0
while True:
    tmp_A = A
    tmp_B = B
    A = (B + C) / 2
    B = (C + tmp_A) / 2
    C = (tmp_B + tmp_A) / 2

    i += 1

    if (A, B, C) in pattern:
        print(0)
        break
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print(i)
        break

    pattern.append((A, B, C))



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

pattern = list()
i = 0
while True:
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print(i)
        break
    tmp_A = A
    tmp_B = B
    A = (B + C) / 2
    B = (C + tmp_A) / 2
    C = (tmp_B + tmp_A) / 2

    i += 1

    if (A, B, C) in pattern:
        print(-1)
        break
    pattern.append((A, B, C))
Buggy code:
import copy
temp=input().split()
A=int(temp[0])
B=int(temp[1])
C=int(temp[2])

setT=[A,B,C]
setT.sort()
allSet=[]
allSet.append(setT)
ans=0
def distribute(x,y,z):
	temp=[y+z,z+x,x+y]
	for i in range(len(temp)):
		if temp[i]%2==0:
			temp[i]/=2
		else:
			return [0]
	return temp

setNext=distribute(A,B,C)
while len(setNext)==3:
	print(setNext)
	ans+=1
	setT=copy.deepcopy(setNext)
	setNext=distribute(setT[0],setT[1],setT[2])
	setNext.sort()
	if setNext in allSet:
		ans=-1
		break
	else:
		allSet.append(setNext)
print(ans)

Fixed code:
import copy
temp=input().split()
A=int(temp[0])
B=int(temp[1])
C=int(temp[2])

setT=[A,B,C]
setT.sort()
allSet=[]
allSet.append(setT)
ans=0
def distribute(x,y,z):
	temp=[y+z,z+x,x+y]
	for i in range(len(temp)):
		if temp[i]%4==0:
			temp[i]/=2
		else:
			return [0]
	return temp

setNext=copy.deepcopy(setT)
for i in setT:
	if i%2==1:
		break
else:
	setNext=distribute(setT[0],setT[1],setT[2])
	ans+=1
	while len(setNext)==3:
		#print(setNext)
		ans+=1
		setT=copy.deepcopy(setNext)
		setNext=distribute(setT[0],setT[1],setT[2])
		setNext.sort()
		if setNext in allSet:
			ans=-1
			break
		else:
			allSet.append(setNext)
print(ans)
Buggy code:
a, b, c = map(int, input().split())


def is_even(a, b, c):
    if a % 2 != 0:
        return False
    if b % 2 != 0:
        return False
    if c % 2 != 0:
        return False
    return True

count = 0
rem = []

flag = True

while is_even(a, b, c) and flag:
    if (a, b, c) in rem:
        print("-1")
        flag = False
        break
    a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2
    count += 1
    rem.append((a, b, c))

if flag is True:
    print(count)


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


def is_even(a, b, c):
    if a % 2 != 0:
        return False
    if b % 2 != 0:
        return False
    if c % 2 != 0:
        return False
    return True

count = 0
rem = []

flag = True

while is_even(a, b, c) and flag:
    a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2
    count += 1
    if (a, b, c) in rem:
        print("-1")
        flag = False
        break
    rem.append((a, b, c))


if flag is True:
    print(count)
Buggy code:
def main():
    a, b, c = map(int, input().split())
    count = 0
    while (a | b | c) & 1 == 0:
        if a==b==c:
            print(-1)
            return
        a, b, c = (b + c) >> 1, (c + a) >> 1, (a + b) >> 1
        count += 1
        print(a,b,c)
    
    print(count)

while True:
    main()


Fixed code:
def main():
    a, b, c = map(int, input().split())
    if a == b == c:
        print(0 if a & 1 else -1)
        return
    count = 0
    while (a | b | c) & 1 == 0:
        a, b, c = (b + c) >> 1, (c + a) >> 1, (a + b) >> 1
        count += 1
    
    print(count)
 
main()
Buggy code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())
print(a,b,c)

count = 0
flag = 0
while True:
    at = (b+c)/2
    bt = (a+c)/2
    ct = (b+c)/2

    if flag == 1 and at == a and bt == b and ct == c:
        flag = 0
        break
    
    a = at
    b = bt
    c = ct
    
    count += 1
    flag = 1
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break

if flag == 0:
    print(-1)
else:
    print(count)


Fixed code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

count = 0
flag = 0
while True:
    at = (b+c)/2
    bt = (a+c)/2
    ct = (b+a)/2

    if flag == 0 and (a % 2 == 1 or b % 2 == 1 or c % 2 == 1):
        flag = 1
        break
    if flag == 1 and at == a and bt == b and ct == c:
        flag = 0
        break
    
    a = at
    b = bt
    c = ct
    #print(a,b,c)
    count += 1
    flag = 1
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break

if flag == 0:
    print(-1)
else:
    print(count)
Buggy code:
A, B, C = map(int, input().split())
dict = {}
ans = 0
while ans < 1000000:
    tpl = tuple(sorted([A, B, C]))
    print(tpl)
    if tpl in dict:
        ans = -1
        break
    elif A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    dict[tpl] = True
    A, B, C = (B + C) // 2, (C + A) // 2, (A + B) // 2
    ans += 1
print(ans)

Fixed code:
A, B, C = map(int, input().split())
dict = {}
ans = 0
while ans < 1000000:
    tpl = tuple(sorted([A, B, C]))
    if tpl in dict:
        ans = -1
        break
    elif A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break
    dict[tpl] = True
    A, B, C = (B + C) // 2, (C + A) // 2, (A + B) // 2
    ans += 1
print(ans)
Buggy code:
a, b, c = input().split()

if (a[-1] == B[0]) and (B[-1] == C[0]):
    print("YES")
else:
    print("NO")


Fixed code:
a, b, c = input().split()
 
if (a[-1] == b[0]) and (b[-1] == c[0]):
    print("YES")
else:
    print("NO")
Buggy code:
a,b,c=input().split()

if a[len(a-1)] == b[0] and b[len(b-1)] == c[0]:
  print("YES")
else:
  print("NO")

Fixed code:
a, b, c = input().rstrip().split()
if a[-1:] == b[0:1] and b[-1:] == c[0:1] :
  print("YES")
else :
  print("NO")
Buggy code:
A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
    ans = "YES"
else:
    print('NO')


Fixed code:
A, B, C = input().split()
if A[-1] is B[0] and B[-1] is C[0]:
    print("YES")
else:
    print("NO")
Buggy code:
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
  print('YES')
  break
else:
  print('NO')

Fixed code:
a, b, c = input().split()
if a[-1]==b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')
Buggy code:
A, B, C = map(int, input().split())
if A[-1] == B[0] and B[-1] == C[0]:
  print("YES")
else:
  print("NO")

Fixed code:
A,B,C=map(str,input().split())
if A[-1]==B[0]and B[-1]==C[0]:
    print("YES")
else:
    print("NO")
Buggy code:
A, B, C = input().split()]

if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
  print("YES")
else:
  print("NO")

Fixed code:
A, B, C = input().split()
     
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
  print("YES")
else:
  print("NO")
Buggy code:
a, b, c = map(input().split())
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')

Fixed code:
a, b, c = input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")
Buggy code:
A,B,C=map(str,input().split())
#print(sorted(B)[0])
if sorted(A)[0]==B[0] and sorted(B)[0]==C[0]:
    print('YES')
else:
    print('NO')

Fixed code:
A,B,C=map(str,input().split())
#print(sorted(B)[0])
if A[::-1][0]==B[0] and B[::-1][0]==C[0]:
    print('YES')
else:
    print('NO')
Buggy code:
A,B,C = list(map(int,input().split()))
if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("NO")

Fixed code:
A,B,C = list(input().split())
if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("NO")
Buggy code:
# ABC060a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = input().split()
print('YNEOS'[a[-1] != b[0] and b[-1] != c[0]::2])


Fixed code:
# ABC060a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = input().split()
print('YNEOS'[a[-1] != b[0] or b[-1] != c[0]::2])