Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input()

if S[A] = "-" and S.count("-") == 1:
  print("Yes")
else:
  print("No")


Fixed submission:
A, B = map(int, input().split())
S = input()

if S[A] == "-" and S.count("-") == 1:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
l = input().split()
a=input()

b=a.split("-")


if len(b[0]) == l[0] and len(b[1])==l[1] and and len(b)<3:
    print('Yes')
else:
    print('No')


Fixed submission:
A, B = map(int, input().split())
S = input()

if S[A] == "-" and S.count("-") == 1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N = input()
list = [int(i) for i in range(N)]

if len(set(list)) <= 2:
  print("Yes")
else:
  print("No")

Fixed submission:
N = input()
N_list = [int(i) for i in N]

if N_list[0] == N_list[1] == N_list[2] or N_list[1] == N_list[2] == N_list[3]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
def Luca(n):
  if n == 0:
    return 2
  elif n == 1:
    return 1
  else:
    return Luca(n-1)+Luca(n-2)
N = int(input())
print(Luca(N))

Fixed submission:
N = int(input())

Luca = [2, 1]
for i in range(N-1):
  Luca[1], Luca[0] = Luca[0]+Luca[1], Luca[1]

print(Luca[1])
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
data = []
for i in range(H):
  S.append(input())
# 参考https://atcoder.jp/contests/abc075/submissions/5409794
for i in range(H):
  for j in range(W):
    if S[i][j] == ".":
      cnt = 0
      if i != 0:
        cnt += S[i-1][min(0, j-1) : min(j+1, W-1) + 1].count("#")
      cnt += S[i][min(0, j-1) : min(j+1, W-1) + 1].count("#")
      if i != H-1:
        cnt += S[i+1][min(0, j-1) : min(j+1, W-1) + 1].count("#")
      S[i][j] = cnt
for i in range(H):
	print("".join(S[i]))

Fixed submission:
H, W = map(int, input().split())
S = []
for i in range(H):
  S.append(list(i for i in input()))
# 参考https://atcoder.jp/contests/abc075/submissions/5409794
for i in range(H):
  for j in range(W):
    if S[i][j] == ".":
      cnt = 0
      if i != 0:
        cnt += S[i-1][max(0, j-1) : min(j+1, W-1) + 1].count("#")
      cnt += S[i][max(0, j-1) : min(j+1, W-1) + 1].count("#")
      if i != H-1:
        cnt += S[i+1][max(0, j-1) : min(j+1, W-1) + 1].count("#")
      S[i][j] = str(cnt)
for i in range(H):
	print("".join(S[i]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
cnt = 0
for i in range(N):
  tmp = int(input())
  cnt += min(abs(K-tmp), (tmp))*2
print(cnt)

Fixed submission:
N = int(input())
K = int(input())
A = list(map(int, input().split()))
cnt = 0
for i in A:
  cnt += min(abs(K-i), (i))*2
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  if tmp not in A:
    A.append(tmp)
  else:
    A.remove(tmp)
    
print(len(A))



Fixed submission:
from collections import Counter
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  A.append(tmp) 
B = Counter(A).values()
cnt = 0
for i in B:
  if i % 2 != 0:
    cnt += 1
  
print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  if tmp not in A:
    A.append(tmp)
  else:
    A.romove(tmp)
    
print(len(A))

Fixed submission:
from collections import Counter
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  A.append(tmp) 
B = Counter(A).values()
cnt = 0
for i in B:
  if i % 2 != 0:
    cnt += 1
  
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = [0]*(max(A)+1)

for i in A:
  ans[i-1] += 1
  ans[i] += 1
  ans[i+1] += 1

  
print(max(ans))



Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0]*(100000+2)

for i in A:
  ans[i-1] += 1
  ans[i] += 1
  ans[i+1] += 1

  
print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

all_data = list(set(A))

num = 0

for i in all_data:
  tmp = A.count(i) + A.count(i+1) + A.count(i-1)
  num = max(num, tmp)
  
print(num)



Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0]*(100000+2)

for i in A:
  ans[i-1] += 1
  ans[i] += 1
  ans[i+1] += 1

  
print(max(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = []
for i in range(N):
  a.append(int(input()))
j = 0
count = 0
flag = False
for i in range(N):
  if a[j] == 2:
    flag = True
    break
  else:
    j = a[j]
    count += 1

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


Fixed submission:
N = int(input())
a = []
for i in range(N):
  a.append(int(input()))
j = 0
count = 1
flag = False

for i in range(N):
  if a[j] == 2:
    flag = True
    break
  else:
    count += 1
    j = a[j]-1


if flag:
  print(int(count))
else:
  print("-1")
Buggy python submission (verdict: Runtime Error):
_
A = list(map(int, input().split()))
A.sort()
print(A[-1]-A[0])

Fixed submission:
_ = input()
A = list(map(int, input().split()))
A.sort()
print(A[-1]-A[0])
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
flag = False
if len(A) > len(B):
  print("GREATER")
elif len(A) < len(B):
  print("LESS")
elif len(A) == len(B):
  for i in range(len(A)):
    if int(A[i]) > int(B[i]):
      print("GREATER")
      break
    elif int(A[i]) < int(B[i]):
      print("LESS")
      break
  flag = True
  
if flag:
  print("EQUAL")

Fixed submission:
A, B, C = input().split()

print(A[0].upper()+B[0].upper()+C[0].upper())
Buggy python submission (verdict: Runtime Error):
import numpy as np
A = np.log10(int(input()))
B = np.log10(int(input()))

if A > B:
  print("A")
else:
  print("B")

Fixed submission:
A = input()
B = input()
flag = True
if len(A) > len(B):
  print("GREATER")
  flag = False
elif len(A) < len(B):
  print("LESS")
  flag = False
elif len(A) == len(B):
  for i in range(len(A)):
    if int(A[i]) > int(B[i]):
      print("GREATER")
      flag = False
      break
    elif int(A[i]) < int(B[i]):
      print("LESS")
      flag = False
      break

  
if flag:
  print("EQUAL")
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
data = [k for k in input()]

ans = Counter(data)
for i in range(n-1):
  tmp = Counter([k for k in input()])
  for j in set(data):
    ans[j] = min(ans[j], tmp[j])
#    print(j, ans[j], tmp[j], min(ans[j], tmp[j]))
ans_list = list(set(list(ans.elements())))
ans_list.sort()
answer = ""
for i in ans_list:
  answer += i*ans[i]
print(answer)


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

if b-a == c-b:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
stu = []
che = []
for i in range(N):
  stu.append(list(map(int, input().split())))
for i in range(M):
  che.append(list(map(int, input().split())))
  
for i in stu:
  x, y = i[0], i[1]
  ans = 0
  tmp = 99999999999999
  for j in che:
    if abs(x-j[0])+abs(y-j[1]) < tmp:
      tmp = abs(x-j[0])+abs(y-j[1])
      ans = j + 1
  print(ans)

Fixed submission:
N, M = map(int, input().split())
stu = []
che = []
for i in range(N):
  stu.append(list(map(int, input().split())))
for i in range(M):
  che.append(list(map(int, input().split())))
  
for i in stu:
  x, y = i[0], i[1]
  ans = 0
  tmp = 99999999999999
  for num, j in enumerate(che):
    if abs(x-j[0])+abs(y-j[1]) < tmp:
      tmp = abs(x-j[0])+abs(y-j[1])
      ans = num + 1
  print(ans)
Buggy python submission (verdict: Runtime Error):
W, a, b = map(int, input().split())

if a+W = b:
  tmp = b-a-W
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
elif a > b+W:
  tmp = a-W-b
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
else:
  print(0)




Fixed submission:
W, a, b = map(int, input().split())

if a+W < b:
  tmp = b-a-W
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
elif a > b+W:
  tmp = a-W-b
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

if A == B:
  print("Draw")
elif A == 1:
  print("Alice")
elif B == 1:
  print("Bob")
elif A > B :
  print("Alice")
else:
  print("Bob")

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

if A == B:
  print("Draw")
elif A == 1:
  print("Alice")
elif B == 1:
  print("Bob")
elif A > B :
  print("Alice")
else:
  print("Bob")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
data = []
for i in range(N):
  data.append(input())
input_data=[]
for i in range(M):
  input_data.append(input())
flag_1 = False
for i in range(N - M + 1):
  for j in range(N - M + 1):
    if flag = False
    for k in range(M):
      for l in range(M):
        if data[i+k][j+l] != input_data[k][l]:
          flag = True
    if flag:
      flag_1 = True

if flag_1:
  print("Yes")
else:
  print("No")
      




Fixed submission:
N, M = map(int, input().split())
data = []
for i in range(N):
  data.append(input())
input_data=[]
for i in range(M):
  input_data.append(input())
flag_1 = False
for i in range(N - M + 1):
  for j in range(N - M + 1):
    flag = True
    for k in range(M):
      for l in range(M):
        if data[i+k][j+l] != input_data[k][l]:
          flag = False
    if flag:
      flag_1 = True

if flag_1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
min_ = 0
max_ = 0
flag_min = False
for i in len(S):
  if flag_min:
    if S[i] == "A":
      min_ = i
      flag_min = True
  else:
    if S[i] == "Z":
      max_ = i
      
print(max_ - min_ + 1)

Fixed submission:
S = input()
min_ = 0
max_ = 0
flag_min = True
for i in range(len(S)):
  if flag_min:
    if S[i] == "A":
      min_ = i
      flag_min = False
  else:
    if S[i] == "Z":
      max_ = i
      
print(max_ - min_ + 1)
Buggy python submission (verdict: Runtime Error):
S = list(input().split())
print(S[0]+" "+S[1]+" "+S[2])

Fixed submission:
S = list(input().split(","))
print(S[0]+" "+S[1]+" "+S[2])
Buggy python submission (verdict: Runtime Error):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    k = S - i -j:
    if k <= 0 and S <= k:
      cnt += 1
print(cnt)


Fixed submission:
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    k = S - i -j
    if 0 <= k and k <= K:
      cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    for k in range(K+1):
      if i+j+k == S:
        cnt += 1
print(cnt)

Fixed submission:
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    k = S - i -j
    if 0 <= k and k <= K:
      cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P]+T[P+1])+X
  print(ans)


Fixed submission:
A, op, B = input().split()
A, B = int(A), int(B)

if op == "+":
  print(A+B)
else:
  print(A-B)
Buggy python submission (verdict: Runtime Error):
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P]+T[P+1])+X
  print(ans)


Fixed submission:
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P-1])+sum(T[P:])+X
  print(ans)

Buggy python submission (verdict: Runtime Error):
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P]+T[P+1])+X

Fixed submission:
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P-1])+sum(T[P:])+X
  print(ans)
Buggy python submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
X, Y = 0, 0
for i in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    X = max(x, X)
  elif a == 2:
    W = min(W, x)
  elif a == 3:
    Y = max(y, Y)
  elif a == 4:
    H = min(H, y)
ans = (W-X)*(H-Y)
if ans <= 0:
  print(0)
else:
  print(ans)


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

if max(a,b,c) == (a+b+c)-max(a,b,c):
  print("Yes")
else:
  print("No")

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

if max(a,b,c) == sum(a,b,c)-max(a,b,c):
  print("Yes")
else:
  print("No")

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

if max(a,b,c) == (a+b+c)-max(a,b,c):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
X, Y = 0, 0
for i in range(N+1):
  x, y, a = map(int, input().split())
  if a == 1:
    X = max(X, x)
  elif a == 2:
    W = min(W, x)
  elif a == 3:
    Y = max(Y, y)
  elif a == 4:
    H = min(H, y)
ans = max(0, (W-X)*(H-Y))
print(ans)


Fixed submission:
W, H, N = map(int, input().split())
X, Y = 0, 0

for i in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    X = max(X, x)
  elif a == 2:
    W = min(W, x)
  elif a == 3:
    Y = max(Y, y)
  elif a == 4:
    H = min(H, y)
    
if (W-X) < 0 or (H-Y) < 0:
  print(0)
else:
  print((W-X)*(H-Y))
Buggy python submission (verdict: Runtime Error):
w = input()
flag = False
arr = []
for i in range(w):
  arr.append(i)
  
set_arr = list(set(arr))
for i in set_arr:
  cout_num = arr.count(i)
  if count_num % 2 != 0:
    flag = True
    break
if flag:
  print("No")
else:
  print("Yes")


Fixed submission:
w = input()
flag = False
arr = []
for i in w:
  arr.append(i)
  
set_arr = list(set(arr))
for i in set_arr:
  count_num = arr.count(i)
  if count_num % 2 != 0:
    flag = True
    break
if flag:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
k=[]
k=list(map(int,input().split())
if k[0]<k[1]:
       print("0")
else:
       print("10")

Fixed submission:
if __name__=="__main__":
    X,A=input().split()
    X=int(X)
    A=int(A)
    if X<A:
        print("0")
    elif X>=A:
        print("10")
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
n=0
i=0
D=0
while(D<=X):
    D=D+L[i]
    n=n+1
    i=i+1
print(n)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
n=1
prev=0
for i in range(N):
    curr=prev+L[i]
    if(curr>X):
        break
    else:
        n=n+1
    prev=curr
print(n)
Buggy python submission (verdict: Runtime Error):
lst = list(int, input().split())

if (lst[0] < lst[1]):
  print(0)
else:
  print(10)

Fixed submission:
lst = list(map(int, input().split()))
 
if (lst[0] < lst[1]):
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):

        print("Yes")

Fixed submission:
n = list(input())
m = 0
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        m += 1
        print("Yes")
        break
if m==0:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = list(int(input()))
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        break
        print("Yes")
if n[1]!=n
print("No")

Fixed submission:
n = list(input())
m = 0
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        m += 1
        print("Yes")
        break
if m==0:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = list(input())
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        break
        print("Yes")
if n[1]!=n
print("No")

Fixed submission:
n = list(input())
m = 0
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        m += 1
        print("Yes")
        break
if m==0:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
print(S - "FESTIVAL")

Fixed submission:
S = input()
print(S[:-8])
Buggy python submission (verdict: Runtime Error):
a b c = map(int, input().split())

if a<=c and c<=b:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c = map(int, input().split())
 
if a<=c and c<=b:
    print("Yes")
else:
    print("No")

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

if a<=c and c<=b:
    print("Yes")
else:
    print(”No”)

Fixed submission:
a, b, c = map(int, input().split())
 
if a<=c and c<=b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
lst = []
for i in range(n):
    a, b = map(int, input().split())
    for j in range(b):
        lst.extend([a])
lst.sort()
print(lst[k-1])

Fixed submission:
n, k = map(int, input().split())
dic = {}
lst = []
ans = 0
for i in range(n):
    a, b = map(int, input().split())
    if (a in dic)==False:
        dic[a] = b
        lst.append(a)
    else:
        dic[a] += b
lst.sort()

for i in range(len(dic)):
    if k > (dic[lst[i]] + ans):
        ans += dic[lst[i]]
    else:
        ans = lst[i]
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
o = list(input())
e = list(input())
ans = ""

num = len(o) - len(e)
if num==0:
    for n in range(len(o)):
        ans += o[n] + e[n]
else:
    for n in range(len(o)):
        ans += o[n] + e[n]
    ans += e[len(o)-1]
print(ans)

Fixed submission:
o = list(input())
e = list(input())
ans = ""

olen = len(o)
num = olen - len(e)
if num==0:
    for n in range(olen):
        ans += o[n] + e[n]
else:
    for n in range(len(e)):
        ans += o[n] + e[n]
    ans += o[olen-1]
print(ans)

Buggy python submission (verdict: Runtime Error):
o = list(input())
e = list(input())
ans = ""

num = len(o)
if num%2==0:
    for n in range(num):
        ans += o[n] + e[n]
else:
    for n in range(num):
        ans += o[n] + e[n]
    ans += o[num-1]
print(ans)

Fixed submission:
o = list(input())
e = list(input())
ans = ""

olen = len(o)
num = olen - len(e)
if num==0:
    for n in range(olen):
        ans += o[n] + e[n]
else:
    for n in range(len(e)):
        ans += o[n] + e[n]
    ans += o[olen-1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1

while n>1:
    ans *= n
    n -= 1
ans %= 10**9 + 7
print(ans)

Fixed submission:
n = int(input())
ans = 1

while n>1:
    ans =  ans * n % (10**9 + 7)
    n -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input()split())
s1 = a*b
s2 = c*d

if s1 > s2:
    print(s1)
else:
    print(s2)

Fixed submission:
a, b, c, d = map(int, input().split())
s1 = a*b
s2 = c*d

if s1 > s2:
    print(s1)
else:
    print(s2)
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
d = list(map(int,input().split()))
 
bound = 0
ans = 1
 
for i in d:
    bound += i
    if bound >x:
        break
        ans += 1
print(ans)
n,x = map(int,input().split())
d = list(map(int,input().split()))

bound = 0
ans = 1

for i in d:
    bound += i
    if bound >x:
        break
    ans += 1
print(ans)

Fixed submission:
n,x = map(int,input().split())
d = list(map(int,input().split()))
 
bound = 0
ans = 1
 
for i in d:
    bound += i
    if bound >x:
        break
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
def pow2(n):
	res = 1
	for i in range(0, n):
		res *= 2
	return res

counter = [0]
N, K = map(int, raw_input().split())
for i in range(1, N+1):
	m = i
	cnt = 1
	while m < K:
		m *= 2
		cnt += 1
	counter.append(cnt)
sum = 0L
for i in range(1, N+1):
	sum += long(pow2(count[1]-count[i]))
sum *= 10000000000
dv = long(N)*long(pow2(count[1]))

print sum
print dv

Fixed submission:
def pow2(n):
	res = 1
	for i in range(0, n):
		res *= 2
	return res

counter = [0]
N, K = map(int, raw_input().split())
for i in range(1, N+1):
	m = i
	cnt = 0
	while m < K:
		m *= 2
		cnt += 1
	counter.append(cnt)
sum = 0
for i in range(1, N+1):
	sum += pow2(counter[1]-counter[i])
dv = N*pow2(counter[1])
print float(sum)/float(dv)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
tree = []
for i in range(0, N):
	tree.append([])
for i in range(0, N-1):
	u, v, w = map(int, input().split())
	tree[u-1].append([v-1, w])
	tree[v-1].append([u-1, w])
oddeven = []
for i in range(0, N):
	oddeven.append(-1)
queue = [[0, 0]]
while queue != []:
	now = queue.pop(0)
	oddeven[now[0]] = now[1]%2
	for i in range(0, len(tree[now[0]])):
		if oddeven[tree[now[0]][i][0]] == -1:
			queue.append([tree[now[0]][i][0], now[1]+tree[now[0]][i][1]])
for i in range(0, N):
	print(oddeven[i])

Fixed submission:
N = int(input())
tree = []
for i in range(0, N):
	tree.append([])
for i in range(0, N-1):
	u, v, w = map(int, input().split())
	tree[u-1].append([v-1, w])
	tree[v-1].append([u-1, w])
oddeven = []
for i in range(0, N):
	oddeven.append(-1)
stack = [[0, 0]]
while stack != []:
	now = stack.pop(-1)
	oddeven[now[0]] = now[1]%2
	for i in range(0, len(tree[now[0]])):
		if oddeven[tree[now[0]][i][0]] == -1:
			stack.append([tree[now[0]][i][0], now[1]+tree[now[0]][i][1]])
for i in range(0, N):
	print(oddeven[i])
Buggy python submission (verdict: Runtime Error):
def removable(s):
	lst = []
	for i in range(0, len(s)-1):
		if s[i] != s[i+1]:
			lst.append(i)
	return lst

S = raw_input()
max = 0
queue = [[S, 0]]
while queue != []:
	now = queue.pop(0)
	removelist = removable(now[0])
	if removelist == []:
		if max < now[1]: max = now[1]
	else:
		for i in range(0, len(removelist)):
			queue.append([now[0][:removelist[i]]+now[0][removelist[i]+2:], now[1]+2])
			print queue

print max

Fixed submission:
def smaller(x, y):
	if x < y: return x
	else: return y

S = raw_input()
count = [0, 0]
for i in range(0, len(S)):
	count[int(S[i])] += 1

print smaller(count[0], count[1])*2
Buggy python submission (verdict: Runtime Error):
N, M = map(int, raw_input().split())
menu = []
for i in range(0, M):
	menu.append(0)
for i in range(0, N):
	answer = map(int, raw_input().split())
	for j in range(1, answer[0]+1):
		menu[answer[i]-1] += 1
cnt = 0
for i in range(0, M):
	if menu[i] == N: cnt += 1

print cnt

Fixed submission:
N, M = map(int, raw_input().split())
menu = []
for i in range(0, M):
	menu.append(0)
for i in range(0, N):
	answer = map(int, raw_input().split())
	for j in range(1, answer[0]+1):
		menu[answer[j]-1] += 1
cnt = 0
for i in range(0, M):
	if menu[i] == N: cnt += 1

print cnt
Buggy python submission (verdict: Runtime Error):
def smaller(x, y):
	if x < y: return x
	return y

N = int(raw_input())
A = map(int, raw_input().split())
A.sort()
min1 = A[0]
for i in range(1, N):
	if A[i]%min != 0 and A[i]%min < min: min = A[i]%min
min2 = A[-1]
for i in range(1, N):
	if min2%A[i] == 0: min2 = A[i]
	else: min2 = min2%A[i] 
print smaller(min1, min2)

Fixed submission:
def euc(x, y):
	if y == 0: return x
	return euc(y, x%y)

N = int(input())
A = list(map(int, input().split()))
ans = A[0]
for i in range(1, N):
	ans = euc(ans, A[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
D, N = map(int, raw_input().split())
if D == 0:
	if N == 100: print 101
	else: print N
if D == 2:
	if N == 100: print 1010000
	else: print str(N) + '0000'
if D == 1:
	n = ((N-1)/9)*10+(N%9)+1
	print str(n)*'00'

Fixed submission:
D, N = map(int, raw_input().split())
ans = ''
if N == 100: ans = '101'
else: ans = str(N)

for i in range(0, D):
	ans = ans + '00'
print ans
Buggy python submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
b - a = x
sum = 0
for i in range(1, x+1):
	sum += i
print sum - b

Fixed submission:
a, b = map(int, raw_input().split())
x = b - a
sum = 0
for i in range(1, x+1):
	sum += i
print sum - b