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

min_ans = 0
for num in nums:
  ans = 0
  tmp = num % 2
  if (tmp == 1):
    break
  ans += 1
  while (tmp % 2 == 0 and ans <= min_ans):
    ans += 1
    tmp = tmp % 2

  if (ans < min_ans):
    min_ans = ans

print(min_ans)
  
    

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

if (nums[0] % 2 == 1):
  print('0')
else:
  tmp = nums[0] / 2
  tmp_ans = 1
  while(tmp % 2 == 0 and tmp > 1):
    tmp_ans += 1
    tmp = tmp / 2

  min_ans = tmp_ans
  
  for num in nums[1:]:
    if (num % 2 == 1):
      min_ans = 0
      break
    tmp = num / 2
    tmp_ans = 1
    while (tmp % 2 == 0 and tmp_ans <= min_ans):
      tmp_ans += 1
      tmp = tmp / 2

    if (tmp_ans < min_ans):
      min_ans = tmp_ans
      
  print(min_ans)
Buggy python submission (verdict: Runtime Error):
x = int(input().split())
if x[0]<x[2]<x[1]:
    print("Yes")
else:
    print("No")

Fixed submission:
x = list(map(int, input().split()))
if x[0]<x[2]<x[1]:
    print("Yes")
elif x[1]<x[2]<x[0]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
w = s[k]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
ss = []
for i in range(n):
    if(s[k] != s[i]):
        ss[i] = "*"
    else:
        ss[i] = s[k]
print(''.join(ss))

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
ss = []
for i in range(n):
    if(s[k] != s[i]):
        ss[i] = "*"
    else:
        ss[i] = s[k]
print(.join(ss))

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
ss = ""
for i in range(n):
    if(s[k] != s[i]):
        ss = ss + "*"
    else:
        ss = ss + s[k]
print(ss)

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
ss = ""
for i in range(n):
    if(s[k] != s[i]):
        ss[i] = "*"
    else:
        ss[i] = s[k]
print(ss)

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

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

n = int(input())
s = input()
k = int(input())
print(re.sub(^s[k],"*",s))

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
w = s[k]
ss = s.replace(w,"*")
print(ss)

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
w = s[k]
for i in range(n):
    if(s[i] != w):
        s[i] = "*"
print(s)

Fixed submission:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B, C, D, E = [int(input()) for _ in range(6)]

towns = [N, 0, 0, 0, 0, 0]
moves = [A, B, C, D, E]
count = 0


def step():
    stack = [0, 0, 0, 0, 0]
    for i in range(5):
        stack[i] = min(towns[i], moves[i])
        towns[i] = max(0, towns[i] - moves[i])
    for i in range(5):
        towns[i+1] = towns[i+1] + stack[i]
    return towns


while True:
    count += 1
    if step()[-1] == N:
        break
print(count)

Fixed submission:
import math

N, A, B, C, D, E = [int(input()) for _ in range(6)]
moves = [A, B, C, D, E]

ans = math.ceil(N/min(moves)) + 4
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
atcg_lst = []
for n in range(N):
    for m in range(n, N):
        s = S[n:m+1]
        atcg = ["ATCG".count(ss) for ss in s]
        if all(atcg):
            atcg_lst.append(sum(atcg))
print(max(atcg_lst))

Fixed submission:
S = input()
N = len(S)
max_n = 0
for n in range(N):
    for m in range(n, N):
        s = S[n:m+1]
        if all("ATCG".count(ss) == 1 for ss in s):
            max_n = max(max_n, len(s))
print(max_n)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
t = [0] * (N-1)
for n in range(N-1):
    if S[n:n+2] == "AC":
        t[n] = 1
for q in range(Q):
    l, r = map(int, input().split())
    print(sum(t[l-1:r-1]))


Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N)
for n in range(N-1):
    add = 1 if S[n:n+2] == "AC" else 0
    t[n+1] = t[n] + add
for q in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
for q in range(Q):
    l, r = map(int, input().split())
    s = S[l-1:r]
    print(s.count("AC"))

Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N)
for n in range(N-1):
    add = 1 if S[n:n+2] == "AC" else 0
    t[n+1] = t[n] + add
for q in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x  = list(map(int, input().split()))
o = len([i for i in range(a, b+1) if i%x == 0])
print(o)

Fixed submission:
a, b, x  = list(map(int, input().split()))
print(b//x - (a-1)//x)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

N = int(input())
S = input()

data = []

def split_data(data, i):
    return (S[:i+1].count('#'),S[i+1:].count('.'))

# .......####### という形を目指す

#累積和を計算
sum_black = [0]
sum_white = [0]
for n in range(0,N+1):
    if S[n] == '#': #black
        sum_black.append(sum_black[n] + 1)
        sum_white.append(sum_white[n] + 0)
    else:
        sum_black.append(sum_black[n] + 0)
        sum_white.append(sum_white[n] + 1)

num_min = N
for n in range(0,N):
    num = sum_black[n] + (sum_white[n] - sum_white[-1]) 
    if num < num_min:
        num_min = num

print(num_min)


Fixed submission:
# coding: utf-8

N = int(input())
S = input()

# .......####### という形を目指す

#累積和を計算
sum_black = [0]
sum_white = [0]
for n in range(0,N):
    if S[n] == '#': #black
        sum_black.append(sum_black[n] + 1)
        sum_white.append(sum_white[n] + 0)
    else:
        sum_black.append(sum_black[n] + 0)
        sum_white.append(sum_white[n] + 1)

num_min = N
for n in range(0,N+1):
    num = sum_black[n] + (sum_white[-1] - sum_white[n]) 
    if num < num_min:
        num_min = num

print(num_min)
Buggy python submission (verdict: Runtime Error):
import math                                             
                                                        
N = input()                                             
t = []                                                  
a = []                                                  
for i in range(int(N)):                                 
    t_n, a_n = input().split()                          
    t.append(int(t_n))                                  
    a.append(int(a_n))                                  
                                                        
t_ans = 0                                               
a_ans = 0                                               
for t_n, a_n in zip(t, a):                              
    k = max(math.ceil(t_ans/t_n), math.ceil(a_ans/a_n)) 
    if not k:                                           
        k = 1                                           
    t_ans = int(k*t_n)                                  
    a_ans = int(k*a_n)                                  
print(t_ans+a_ans)                                      
                                                        


Fixed submission:
a = []              
a = input().split() 
s = set(a)          
print(len(s))

Buggy python submission (verdict: Runtime Error):
a = []                
for i in range(3):    
    a.append(input()) 
                      
s = set(a)            
print(len(s))         


Fixed submission:
a = []              
a = input().split() 
s = set(a)          
print(len(s))
Buggy python submission (verdict: Runtime Error):
w = input()                
l = list(w)                
l.sort()                   
ans = "Yes"                
for i in range(len(l)/2):    
    if l[2*i] != l[2*i+1]: 
        ans = "No"         
        break              
print(ans)                 
                           
                           


Fixed submission:
w = input()                    
l = list(w)                    
l.sort()                       
ans = "Yes"                    
if len(l)%2 != 0:
    print("No")
    exit()
for i in range(int(len(l)/2)): 
    if l[2*i] != l[2*i+1]:     
        ans = "No"             
        break                  
print(ans)

Buggy python submission (verdict: Runtime Error):
w = input()                
l = list(w)                
l.sort()                   
ans = "Yes"                
for i in range(len(l)):    
    if l[2*i] != l[2*i+1]: 
        ans = "No"         
        break              
print(ans)                 
                           
                           


Fixed submission:
w = input()                    
l = list(w)                    
l.sort()                       
ans = "Yes"                    
if len(l)%2 != 0:
    print("No")
    exit()
for i in range(int(len(l)/2)): 
    if l[2*i] != l[2*i+1]:     
        ans = "No"             
        break                  
print(ans)
Buggy python submission (verdict: Runtime Error):
a= input()
b = input().split()
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
if s-max(b)>max(b):
    print("Yes")
else:
    print("No")

Fixed submission:
a= input()
b = input().split()
b = [int(s) for s in b]
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
if s-int(max(b))>int(max(b)):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a= input()
b = input().split()
s = 0
for i in range(0,len(b)):
               s+=int(b[i])
if s-max(b)>max(b):
  print("Yes")
else:
  print("No)

Fixed submission:
a= input()
b = input().split()
b = [int(s) for s in b]
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
if s-int(max(b))>int(max(b)):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N,M,C=map(int, input().split())
# N:Aのソースコード(配列)数
# M:AとBの配列の中身の数
# C:計算で利用

B=list(map(int,input.split()))
A=[]
for i in range(N):
  a=map(int,input().split())
  A.append(a)
    
ans=0
x=0
for i in range(N):
  for j in range(M):
     ans+=A[i][j]*B[j]
  if ans+C>0:
     x+=1

print(x)

Fixed submission:
N,M,C=map(int, input().split())
# N:Aのソースコード(配列)数
# M:AとBの配列の中身の数
# C:計算で利用

B=list(map(int,input().split()))
A=[]
for i in range(N):
  a=list(map(int,input().split()))
  A.append(a)
    
x=0
for i in range(N):
  ans=0
  for j in range(M):
     ans+=A[i][j]*B[j]
  if ans+C>0:
     x+=1


print(x)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
# N:売店数
# M:買う数
AB=[]
for i in range(N):
  ab=list(map(int,input().split()))
  AB.append(ab)
#AB[0]:A円，AB[1]:最大B本まで買える

list.sort(AB,key=lambda x:x[0])
#print(AB)

m=0 #買う数
cost=0 #かかる値段
for i in range(N):
 
 if M-m==AB[i][1]:
     m+=AB[i][1]
     cost+=AB[i][0]*AB[i][1]
     break

 elif M-m<AB[i][1] :
      for j in range(AB[i][1]+1):
         cost=cost+AB[i][0]*j
         m=m+j
         if m==M:
             break
        else:
             cost=cost-AB[i][0]*j
 else:
      cost+=AB[i][0]*AB[i][1]
      m+=AB[i][1]
    
print(cost)

Fixed submission:
N,M=map(int,input().split())
# N:売店数
# M:買う数
AB=[]
for i in range(N):
  ab=list(map(int,input().split()))
  AB.append(ab)
#AB[0]:A円，AB[1]:最大B本まで買える

list.sort(AB,key=lambda x:x[0])
#print(AB)

m=0 #買う数
cost=0 #かかる値段
for i in range(N):
 
 if M-m==AB[i][1]:
     m+=AB[i][1]
     cost+=AB[i][0]*AB[i][1]
     break
 elif M-m<AB[i][1] :
      for j in range(AB[i][1]+1):
         cost=cost+AB[i][0]*j
         m=m+j
         if m==M:
             break
         elif m<M:
             cost=cost-AB[i][0]*j
             m=m-j
 else:
      cost+=AB[i][0]*AB[i][1]
      m+=AB[i][1]
    
print(cost)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
# N:売店数
# M:買う数
AB=[]
for i in range(N):
  ab=list(map(int,input().split()))
  AB.append(ab)
#AB[0]:A円，AB[1]:最大B本まで買える

list.sort(AB,key=lambda x:x[0])
#print(AB)

m=0 #買う数
cost=0 #かかる値段
for i in range(N):
 
 if M-m==A[i][1]
 m+=A[i][1]
 cost+=AB[i][0]*AB[i][1]
 break

 elif M-m<A[i][1] :
      for j in range(AB[i][1]+1):
         cost=cost+AB[i][0]*j
         m=m+j
         if m==M:
             break

 cost+=AB[i][0]*AB[i][1]
 m+=A[i][1]
    
print(cost)

Fixed submission:
N,M=map(int,input().split())
# N:売店数
# M:買う数
AB=[]
for i in range(N):
  ab=list(map(int,input().split()))
  AB.append(ab)
#AB[0]:A円，AB[1]:最大B本まで買える

list.sort(AB,key=lambda x:x[0])
#print(AB)

m=0 #買う数
cost=0 #かかる値段
for i in range(N):
 
 if M-m==AB[i][1]:
     m+=AB[i][1]
     cost+=AB[i][0]*AB[i][1]
     break
 elif M-m<AB[i][1] :
      for j in range(AB[i][1]+1):
         cost=cost+AB[i][0]*j
         m=m+j
         if m==M:
             break
         elif m<M:
             cost=cost-AB[i][0]*j
             m=m-j
 else:
      cost+=AB[i][0]*AB[i][1]
      m+=AB[i][1]
    
print(cost)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
  
a=int(a)
b=int(b)
c=int(c)
x=int(x)

x=b//a
  
if x>=c:
  print(c)
else :
  print(x)


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

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
  
a=int(a)
b=int(b)
c=int(c)
x=int(x)

x=b//a
  
if x>=c:
  print(c)
else :
  print(x)


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

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
  
a=int(a)
b=int(b)
c=int(c)
x=int(x)

x=b//a:
  
if x>=c:
  print(c)
else :
  print(x)


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

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
  
a=int(a)
b=int(b)
c=int(c)
x=int(x)

x=b//a
  
if x>=c:
  print(c)
else 
  print(x)


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

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
  
a=int(a)
b=int(b)
c=int(c)
x=int(x)

x=b//a
  
if(x>=c)
print(c)
else 
print(x)


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

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
  
  a=int(a)
  b=int(b)
  c=int(c)
  x=int(x)
  x=b//a
  
  if(x>=c)
    print(c)
    else 
      print(x)


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

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)

Buggy python submission (verdict: Runtime Error):
a=input()
  b=input()
  c=input()
  
  int(a)
  int(b)
  int(c)
  int(x)
  x=b//a
  
  if(x>=c)
    print(c)
    else 
      print(x)

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

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
a=[]
b=[]
if A>=B:
  for i in range(1,A+1): # i = [1,2,3,4,....A]
    if A%i==0 and B%i==0:
      a.append( A/i )
      b.append( B/i )
  
else:
  for i in range(1,B+1): # i = [1,2,3,4,....A]
    if A%i==0 and B%i==0:
      a.append( A/i )
      b.append( B/i )

c=[]
for ea in a:
  if ea in b:
    c.append( ea )

print(c[K])
    


Fixed submission:
A, B, K = map(int, input().split())
a=[]
#b=[]
if A>=B:
  for i in range(1, A+1): # i = [1,2,3,4,....A]
    if A%i==0 and B%i==0:
      a.append( i )
      # b.append( B/i )
  
else:
  for i in range(1, B+1): # i = [1,2,3,4,....A]
    if A%i==0 and B%i==0:
      a.append( i )
      # b.append( B/i )

#print(a)
#print(b)

#c=[]
#for ea in a:
 # if ea in b:
  #  c.append( ea )
c=len(a)
print(a[c-K])
Buggy python submission (verdict: Runtime Error):
A, B=map(int, input().split())

if B%A==0:
    print(A+B)
else
  print(A-B)

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):
import re

N = int(input())
S = str(input())
K = int(input())

print(re.sub(r'[^%s]'%S[K], '*', S))

Fixed submission:
import re

N = int(input())
S = str(input())
K = int(input())

print(re.sub(r'[^%s]'%S[K-1], '*', S))
Buggy python submission (verdict: Runtime Error):
a = int(input().split())
b = int(input().split())
c = int(input().split())
d = int(input().split())
e = int(input().split())
k = int(input().split())

if e-a <= k:
	print("Yay!")
else :
	print(":(")

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
	print("Yay!")
else:
	print(":(")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

X, Y, Z, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort(reverse=True)
B = [int(x) for x in input().split()]
B.sort(reverse=True)
C = [int(x) for x in input().split()]
C.sort(reverse=True)
 
list_ = [b+c for (b,c) in itertools.product(B, C)]
list_.sort(reverse=True)
 
list__ = [ab+c for (ab,c) in itertools.product(list_[:K], A)]
list__.sort(reverse=True)
for N in list__[:K]:
  print(N)

Fixed submission:
import itertools

X, Y, Z, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
 
list_ = [b+c for (b,c) in itertools.product(B, C)]
list_.sort(reverse=True)
 
list__ = [ab+c for (ab,c) in itertools.product(list_[:K], A)]
list__.sort(reverse=True)
for N in list__[:K]:
  print(N)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

X, Y, Z, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]

list_ = [a+b+c for (a,b,c) in itertools.product(A, B, C)]
list_.sort(reverse=True)
for N in list_[:K]:
  print(N)

Fixed submission:
import itertools

X, Y, Z, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
 
list_ = [b+c for (b,c) in itertools.product(B, C)]
list_.sort(reverse=True)
 
list__ = [ab+c for (ab,c) in itertools.product(list_[:K], A)]
list__.sort(reverse=True)
for N in list__[:K]:
  print(N)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = [int(x) for x in input().split()]
S = str(input())

ac_list = []
for (idx, (s1, s2)) in enumerate(zip(S[:-1], S[1:])):
  if s1 == 'A' and s2 == 'C':
    ac_list.append(idx+1)

for _ in range(Q):
  l, r = [int(x) for x in input().split()]
  print(len([x for x in ac_list if l<=x<r]))



Fixed submission:
import bisect
N, Q = [int(x) for x in input().split()]
S = str(input())

ac_list = []
for (idx, (s1, s2)) in enumerate(zip(S[:-1], S[1:])):
  if s1 == 'A' and s2 == 'C':
    ac_list.append(idx+1)

for _ in range(Q):
  l, r = [int(x) for x in input().split()]
  index_l = bisect.bisect_left(ac_list, l)
  index_r = bisect.bisect_left(ac_list, r)
  print(index_r - index_l)
Buggy python submission (verdict: Runtime Error):
N = int(input())
b = [int(x) for x in input().split()]

if sum([(x > idx + 1) for (idx, x) in enumerate(b)]) >= 1:
  print(-1)

list_ = []
while len(b) > 0:
  for idx, c in enumerate(b):
    if idx+1 == c:
      del_idx = idx
  list_.append(b.pop(del_idx))
  
for c in list_[::-1]:
	print(c)
    

Fixed submission:
N = int(input())
b = [int(x) for x in input().split()]

if sum([(x > idx + 1) for (idx, x) in enumerate(b)]) >= 1:
  print(-1)
else:
  list_ = []
  while len(b) > 0:
    for idx, c in enumerate(b):
      if idx+1 == c:
        del_idx = idx
    list_.append(b.pop(del_idx))

  for c in list_[::-1]:
      print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
C = [int(input()) for _ in range(N)]
C = [x for (x,y) in zip(C[:-1], C[1:]) if x!=y] + [C[-1]]

SUM = 1
DP_dict = {}

for c in C:
  if c in DP_dict.keys():
    SUM += DP_dict[c] = SUM
  DP_dict[c] = SUM

print(SUM % (10**9+7))

Fixed submission:
N = int(input())
C = []
tmp_b = -1
for _ in range(N):
  tmp_n = int(input())
  if tmp_n != tmp_b:
    C.append(tmp_n)
    tmp_b = tmp_n

SUM = 1
DP_dict = {}

for c in C:
  if c not in DP_dict.keys():
    DP_dict[c] = SUM
  else:
    SUM += DP_dict[c]
    DP_dict[c] = SUM

print(SUM % (10**9+7))
Buggy python submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split()]
list_ = []
for k in range(1, min(A,B)):
  if A % k == 0 and B % k == 0:
    list_.append(k)
print(list_[len(list_)-K+1])

Fixed submission:
A, B, K = [int(x) for x in input().split()]
list_ = []
for k in range(1, min(A,B)+1):
  if A % k == 0 and B % k == 0:
    list_.append(k)
print(list_[::-1][K-1])
Buggy python submission (verdict: Runtime Error):
t, x = map(int, raw_input.split()) 
print(t/x)

Fixed submission:
t, x = map(int, input().split()) 
print(t/x)

Buggy python submission (verdict: Runtime Error):
t, x = map(int, input.split()) 
print(t/x)

Fixed submission:
t, x = map(int, input().split()) 
print(t/x)