Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = [int(input()) for i in range(5)]
m = 10
#1の位が最も小さいものはそのまま足す・残りは1の位を切り上げて足す

for i in n:
  if int(str(i)[-1]) < m and int(str(i)[-1]) > 0:
    m = int(str(i)[-1])
    x = i

n.remove(x)
    
for i in range(len(n)):
  if n[i]%10 != 0:
    n[i] = n[i] + 10 - int(str(n[i])[-1])

print(sum(n) + x)

Fixed submission:
n = [int(input()) for i in range(5)]
m = 10
x = n[0]
#1の位が最も小さいものはそのまま足す・残りは1の位を切り上げて足す

for i in n:
  if int(str(i)[-1]) < m and int(str(i)[-1]) > 0:
    m = int(str(i)[-1])
    x = i



n.remove(x)
    
for i in range(len(n)):
  if n[i]%10 != 0:
    n[i] = n[i] + 10 - int(str(n[i])[-1])

print(sum(n) + x)

Buggy python submission (verdict: Runtime Error):
n = [int(input()) for i in range(5)]
m = 9
#1の位が最も小さいものはそのまま足す・残りは1の位を切り上げて足す

for i in n:
  if int(str(i)[-1]) < m and int(str(i)[-1]) > 0:
    m = int(str(i)[-1])
    x = i

n.remove(x)
    
for i in range(len(n)):
  if n[i]%10 != 0:
    n[i] = n[i] + 10 - int(str(n[i])[-1])

print(sum(n) + x)

Fixed submission:
n = [int(input()) for i in range(5)]
m = 10
x = n[0]
#1の位が最も小さいものはそのまま足す・残りは1の位を切り上げて足す

for i in n:
  if int(str(i)[-1]) < m and int(str(i)[-1]) > 0:
    m = int(str(i)[-1])
    x = i



n.remove(x)
    
for i in range(len(n)):
  if n[i]%10 != 0:
    n[i] = n[i] + 10 - int(str(n[i])[-1])

print(sum(n) + x)

Buggy python submission (verdict: Runtime Error):
n = [int(input()) for i in range(5)]
m = 9
#1の位が最も小さいものはそのまま足す・残りは1の位を切り上げて足す

for i in n:
  if int(str(i)[-1]) < m:
    m = int(str(i)[-1])
    x = i

n.remove(x)
    
for i in range(len(n)):
  if n[i]%10 != 0:
    n[i] = n[i] + 10 - int(str(n[i])[-1])

print(sum(n) + x)

Fixed submission:
n = [int(input()) for i in range(5)]
m = 10
x = n[0]
#1の位が最も小さいものはそのまま足す・残りは1の位を切り上げて足す

for i in n:
  if int(str(i)[-1]) < m and int(str(i)[-1]) > 0:
    m = int(str(i)[-1])
    x = i



n.remove(x)
    
for i in range(len(n)):
  if n[i]%10 != 0:
    n[i] = n[i] + 10 - int(str(n[i])[-1])

print(sum(n) + x)
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int,input().split())
s = list(input())
lr = [list(map(int,input().split())) for i in range(q)]
ans = []

for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        s[i] = "*"

for i in range(n):
    ans.append(s[:i].count("*"))

for i in lr:
    l = i[0]
    r = i[1]
    print(ans[r-1] - ans[l-1])


Fixed submission:
n, q = map(int,input().split())
s = list(input())
lr = [list(map(int,input().split())) for i in range(q)]
ans = [0]
x = 0

for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        x += 1
    ans.append(x)

for i in lr:
    l = i[0]
    r = i[1]
    print(ans[r-1] - ans[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int,input().split())
s = list(input())
lr = [list(map(int,input().split())) for i in range(q)]

for x in lr:
    ans = 0
    l = x[0]
    r = x[1]
    a = s[l-1:r]
    for i in range(r-l):
        if a[i] == "A" and a[i+1] == "C":
            ans += 1
    print(ans)

Fixed submission:
n, q = map(int,input().split())
s = list(input())
lr = [list(map(int,input().split())) for i in range(q)]
ans = [0]
x = 0

for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        x += 1
    ans.append(x)

for i in lr:
    l = i[0]
    r = i[1]
    print(ans[r-1] - ans[l-1])
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int,input().split())

def cf(x1,x2):
    cf=[]
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

ans = cf(a,b)
ans.sort(reverse=True)

print(ans[k-1])

Fixed submission:
a, b, k = map(int,input().split())
 
def cf(x1,x2):
    cf=[]
    for i in range(1,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

ans = cf(a,b)
ans.sort(reverse=True)

print(ans[k-1])
Buggy python submission (verdict: Runtime Error):
x, y = map(int,input().split()))
  
if b%a == 0:
  print(a+b)
else:
  print(b-a)

Fixed submission:
a, b = map(int,input().split())
  
if b%a == 0:
  print(a+b)
else:
  print(b-a)
Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
w = "keyence"

for i in range(7):
    if S[:i] == w[:i] and s[n-7+i:] == w[i:]:
        print("YES")
        exit()

print("NO")

Fixed submission:
s = input()
n = len(s)
w = "keyence"
 
for i in range(7):
    if s[:i] == w[:i] and s[n-7+i:] == w[i:]:
        print("YES")
        exit()

print("NO")

Buggy python submission (verdict: Runtime Error):
s = list(input())
ans = list("keyence")
x = 0

for c in s:
    if c == ans[x]:
        x += 1

if x >= 6:
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()
n = len(s)
w = "keyence"
 
for i in range(7):
    if s[:i] == w[:i] and s[n-7+i:] == w[i:]:
        print("YES")
        exit()

print("NO")
Buggy python submission (verdict: Runtime Error):
s = input()

def fact(n):
    if n > 1:
        return n * fact(n-1)
    else:
        return 1

print(fact(s.count("B")))

Fixed submission:
s = list(input())
n = len(s)
ans = 0
count = 0

for i in range(n):
    if s[i] == "W":
        ans += i
        count += 1

print(ans-count*(count-1)//2)
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
h =[int(input()) for i in range(n)]
h.sort()
ans = 100000000

for i in range(len(h)-k+1):
    if h[i+k-1] - h[i] < ans:
        ans = h[i+k-1] - h[i]
        if ans = 0:
            break

print(ans)

Fixed submission:
n, k = map(int,input().split())
h =[int(input()) for i in range(n)]
h.sort()
ans = 1000000000000

for i in range(len(h)-k+1):
    if h[i+k-1] - h[i] < ans:
        ans = h[i+k-1] - h[i]
        if ans == 0:
            break

print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(imput())

if x == 7 or x == 5 or x == 3:
  print("YES")
else:
  print("NO")

Fixed submission:
x = int(input())
 
if x == 7 or x == 5 or x == 3:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n, t = map(int,input().split())
ans = []

for i in range(n):
  c, x = map(int,input().split())
  if x <= t:
    ans.append(c)
    
ans.sort()
print(ans[0])

Fixed submission:
n, t = map(int,input().split())
ans = []

for i in range(n):
  c, x = map(int,input().split())
  if x <= t:
    ans.append(c)

if len(ans) == 0:
    print("TLE")
else:
    ans.sort()
    print(ans[0])
Buggy python submission (verdict: Runtime Error):
s=list(input())
for c in s:
  if c == "1":
    print("9",end="")
  elif c = "9":
    print("1",end="")
  else:
    print(c)
print()

Fixed submission:
s=list(input())
for c in s:
  if c == "1":
    print("9",end="")
  elif c == "9":
    print("1",end="")
  else:
    print(c)
print()
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]

for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd(*d))

Fixed submission:
import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]
 
for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd(*d))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]

for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd(*d))

Fixed submission:
import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]
 
for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd(*d))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]

for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd_list(d))

Fixed submission:
import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]
 
for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd(*d))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]

for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd_list(d))

Fixed submission:
import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

n, x = map(int,input().split())
li = list(map(int,input().split()))
d = [abs(x-li[0])]
 
for i in range(n-1):
    d.append(abs(li[i]-li[i+1]))

print(gcd(*d))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
ans = 0

for i in range(10000, 10000000)[::-1]:
    x = 0
    for j in l:
        x += i%j
    if x > ans:
        ans = x

print(ans)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))

print(sum(li)-n)
Buggy python submission (verdict: Runtime Error):
import math
 
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

n = int(input())
print(lcm(2,n))

Fixed submission:
import fractions

n = int(input())
print(n * 2 // fractions.gcd(2, n))

Buggy python submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

n = int(input())
print(lcm(2,n))

Fixed submission:
import fractions

n = int(input())
print(n * 2 // fractions.gcd(2, n))
Buggy python submission (verdict: Runtime Error):
import statistics

n = int(input())
li = list(map(int,input().split()))
median_low = statistics.median_low(li)
median_high = statistics.median_high(li)

for i in li:
    if i <= median_low:
        print(median_high)
    else:
        print(median_low)

Fixed submission:
import statistics

n = int(input())
li = list(map(int,input().split()))
median_low = statistics.median_low(li)
median_high = statistics.median_high(li)

for i in li:
    if i <= median_low:
        print(median_high)
    else:
        print(median_low)
Buggy python submission (verdict: Runtime Error):
s = input()
s[3] = "8"
print(s)

Fixed submission:
print(input().replace('2017', '2018'))

Buggy python submission (verdict: Runtime Error):
s = input()
s[3] = 8
print(s)

Fixed submission:
print(input().replace('2017', '2018'))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = [list(map(int,input().split())) for i in range(n-1)] #csf

for i in range(n-1):
    t = li[i][1] + li[i][0]
    for j in range(i+1,n-1):
        while True:
            if t >= li[j][1] and t%li[j][2] == 0:
                break
            else:
                t += 1
        t += li[j][0]
    print(t)
print(0)

Fixed submission:
n = int(input())
li = [list(map(int,input().split())) for i in range(n-1)] #csf

for i in range(n-1):
    t = li[i][1] + li[i][0]
    for j in range(i+1,n-1):
        while True:
            if t >= li[j][1] and t%li[j][2] == 0:
                break
            else:
                t += 1
        t += li[j][0]
    print(t)
print(0)
Buggy python submission (verdict: Runtime Error):
s = int(input())
x = 0

for i in s:
  x += int(i)

if s%x == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
s = int(input())
x = 0
 
for i in str(s):
  x += int(i)
 
if s%x == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = 2
y = 1

for i in range(n-1):
    ans = x + y
    x = y
    y = ans

print(ans)

Fixed submission:
n = int(input())
x = 2
y = 1

if n == 1:
    ans = 1

for i in range(n-1):
    ans = x + y
    x = y
    y = ans

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(input()) for i in range(n)]
x = set(l)
ans = 0

for i in x:
  y = l.count(i)
  if y%2 == 1:
      ans += 1
    
print(ans)

Fixed submission:
import collections

n = int(input())
li = [int(input()) for i in range(n)]
c = collections.Counter(li)
ans = 0

for item in c.items():
    if item[1]%2 == 1:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []

for i in range(n):
  x = int(input())
  if x in l:
    l.remove(x)
  else:
    l.append(x)

print(len(l))

Fixed submission:
import collections

n = int(input())
li = [int(input()) for i in range(n)]
c = collections.Counter(li)
ans = 0

for item in c.items():
    if item[1]%2 == 1:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [0]*100000000

for i in range(n):
  x = int(input())
  if l[x-1] == 0:
    l[x-1] = 1
  else:
    l[x-1] = 0

print(l.count(1))

Fixed submission:
import collections

n = int(input())
li = [int(input()) for i in range(n)]
c = collections.Counter(li)
ans = 0

for item in c.items():
    if item[1]%2 == 1:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [0]*1000000000

for i in range(n):
  x = int(input())
  if l[x-1] == 0:
    l[x-1] = 1
  else:
    l[x-1] = 0

print(l.count(1))

Fixed submission:
import collections

n = int(input())
li = [int(input()) for i in range(n)]
c = collections.Counter(li)
ans = 0

for item in c.items():
    if item[1]%2 == 1:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = 0

for x in range(min(li), max(li)+1):
    if x == min(li):
        a = li.count(x-1)
        b = li.count(x)
        c = li.count(x+1)

    else:
        a = b
        b = c
        c = li.count(x+1)
    
    y = a+b+c
    if y > ans:
        ans = y
    
print(ans)


Fixed submission:
import collections

n = int(input())
li = list(map(int,input().split()))
ans = []

for i in li:
    ans.append(i-1)
    ans.append(i)
    ans.append(i+1)

c = collections.Counter(ans)

print(c.most_common()[0][1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = 0

for x in range(min(li), max(li)+1):
    if x == min(li):
        a = li.count(x-1)
        b = li.count(x)
        c = li.count(x+1)

    else:
        a = b
        b = c
        c = li.count(x+1)
    
    y = a+b+c
    if y > ans:
        ans = y
    
print(ans)


Fixed submission:
import collections

n = int(input())
li = list(map(int,input().split()))
ans = []

for i in li:
    ans.append(i-1)
    ans.append(i)
    ans.append(i+1)

c = collections.Counter(ans)

print(c.most_common()[0][1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = 0

for x in range(min(li), max(li)+1):
    y = li.count(x-1) + li.count(x) + li.count(x+1)
    if y > ans:
        ans = y
    
print(ans)


Fixed submission:
import collections

n = int(input())
li = list(map(int,input().split()))
ans = []

for i in li:
    ans.append(i-1)
    ans.append(i)
    ans.append(i+1)

c = collections.Counter(ans)

print(c.most_common()[0][1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = 0

for i in range(min(li), max(li)+1):
  x = 0
  for j in li:
    if i-1 <= j <= i+1:
      x += 1
  if x > ans:
    ans = x
    
print(ans)

Fixed submission:
import collections

n = int(input())
li = list(map(int,input().split()))
ans = []

for i in li:
    ans.append(i-1)
    ans.append(i)
    ans.append(i+1)

c = collections.Counter(ans)

print(c.most_common()[0][1])
Buggy python submission (verdict: Runtime Error):
s = list(input())
s = set(s).sort()
t = "abcdefghijklmnopqrstuvwxyz"

for c in t:
  if t in s:
    cotinue
  else:
    print(c)
    exit()

Fixed submission:
s = list(input())
set(s)
s.sort()
t = list("abcdefghijklmnopqrstuvwxyz")

for c in t:
  if c in s:
    continue
  else:
    print(c)
    exit()

print("None")
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
t = [int(input()) for i in range(n)]

print(lcm_list(t))

Fixed submission:
s = list(input())
if s[0] == s[2]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
t = [int(input()) for i in range(n)]

print(lcm(*t))

Fixed submission:
import fractions
from functools import reduce
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
 
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
 
n = int(input())
t = [int(input()) for i in range(n)]
 
print(lcm(*t))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
t = [int(input()) for i in range(n)]

print(lcm_list(t))

Fixed submission:
import fractions
from functools import reduce
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
 
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
 
n = int(input())
t = [int(input()) for i in range(n)]
 
print(lcm(*t))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
t = [int(input()) for i in range(n)]

print(lcm_list(t))

Fixed submission:
import fractions
from functools import reduce
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
 
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
 
n = int(input())
t = [int(input()) for i in range(n)]
 
print(lcm(*t))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = 10000000000000

for i in range(1,n):
  x = abs(sum(li[:i])-sum(li[i:]))
  if x < ans:
    ans = x

print(ans)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
ans = 10000000000000
x = 0
y = sum(li)

for i in range(0,n-1):
    x += li[i]
    y -= li[i]
    z = abs(x-y)
    if z < ans:
        ans = z

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = []

for i in li:
    ans.append(i)
    ans = ans[::-1]

print(*ans)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))

if n%2 == 0:
    ans = li[1::2][::-1] + li[::2]
else:
    ans = li[::2][::-1] + li[1::2]

print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
x = [1]
y = 1

for i in range(n):
    y = a[y-1]
    x.append(y)
    if y == 2:
        break
    if x.count(y) == 2:
        print(-1)
        exit()

print(len(x)-1)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)] #ボタンの仕様
x = [1] #遷移
 
for i in range(n):
    y = x[-1] #今の場所
    z = a[y-1]
    x.append(z)
    if z == 2:
        print(len(x)-1)
        exit()

print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
x = [1]
y = 1

while y != 2:
    y = a[y-1]
    x.append(y)
    if x.count(y) == 2:
        print(-1)
        exit()

print(len(x)-1)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)] #ボタンの仕様
x = [1] #遷移
 
for i in range(n):
    y = x[-1] #今の場所
    z = a[y-1]
    x.append(z)
    if z == 2:
        print(len(x)-1)
        exit()

print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
x = 0
y = 0

if sum(s)%10 != 0:
    print(sum(s))

else:
    while y == 0:
        if s[x]%10 != 0:
            s.pop(x)
            y = 1
            break
        else:
            x += 1
        if x == len(s)-1:
            print(0)
            exit()

    print(sum(s))

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
x = 0
y = 0

if sum(s)%10 != 0:
    print(sum(s))

else:
    while y == 0:
        if s[x]%10 != 0:
            s.pop(x)
            y = 1
            break
        else:
            x += 1
        
        if x >= len(s)-1:
            print(0)
            exit()

    print(sum(s))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
ans  = []

for i in range(n):
    x, y = map(int,input().split())
    ans += [x]*y

ans.sort()
print(ans[k-1])

Fixed submission:
n, k = map(int,input().split())
ans  = []
x = 0

for i in range(n):
    ans.append(list(map(int,input().split())))

ans.sort()

for l in ans:
    x += l[1]
    if x < k:
        continue
    else:
        print(l[0])
        exit()
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int,input().split())
ans = 0

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

while x%2 == 0 and y%2 == 0 and z%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)


Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int,input().split())
ans = 0

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

while x%2 == 0 and y%2 == 0 and z%2 == 1:
    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)


Fixed submission:
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)
Buggy python submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
x = 0 #まだ未定なら0、単調増加なら1、単調減少なら-1にする
i = 0 #index
ans = 0

while True:
    if x == 0:
        if li[i] < li[i+1]:
            x = 1
        elif li[i] > li[i+1]:
            x = -1
        else:
            x = 0
    if x == 1:
        if li[i] > li[i+1]:
            ans += 1
            x = 0
    if x == -1:
        if li[i] < li[i+1]:
            ans += 1
            x = 0
    i += 1
    if i == n-1:
        break

print(ans+1)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
x = 0 #まだ未定なら0、単調増加なら1、単調減少なら-1にする
i = 0 #index
ans = 0

if n == 1:
    print(1)
    exit()

while True:
    if x == 0:
        if li[i] < li[i+1]:
            x = 1
        elif li[i] > li[i+1]:
            x = -1
        else:
            x = 0
    if x == 1:
        if li[i] > li[i+1]:
            ans += 1
            x = 0
    if x == -1:
        if li[i] < li[i+1]:
            ans += 1
            x = 0
    i += 1
    if i == n-1:
        break
print(ans+1)
Buggy python submission (verdict: Runtime Error):
x, y = map(int,input().split())
z = z+y
print(z) if z < 25 else print(z-24)

Fixed submission:
x, y = map(int,input().split())
z = x+y
print(z) if z < 24 else print(z-24)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
x = 0
ans = 0

for c in x:
  if c == "I":
    x += 1
  else:
    x -= 1
  if x > ans:
    ans = x

print(ans)

Fixed submission:
n = int(input())
s = input()
x = 0
ans = 0

for c in s:
  if c == "I":
    x += 1
  else:
    x -= 1
  if x > ans:
    ans = x

print(ans)