Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S=input()
for i in range(2):
  if a[i]==a[i+1]:
    print("Bad")
    return
print("Good")

Fixed submission:
S=input()
for i in range(3):
  if S[i]==S[i+1]:
    print("Bad")
    exit()
print("Good")

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x,y):
  return x*y/math.gcd(x,y)
def numantidiv(a,b,c):
    r=a-math.floor(a/b)-math.floor(a/c)+math.floor(a/lcm(b,c))
    return r

a,b,c,d=(int(x) for x in input().split())
ans=numantidiv(b,c,d)-numantidiv(a-1,c,d)
print(ans)

Fixed submission:
S=input()
for i in range(3):
  if S[i]==S[i+1]:
    print("Bad")
    exit()
print("Good")

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x,y):
  return x*y/math.gcd(x,y)
def numantidiv(a,b,c):
    r=a-math.floor(a/b)-math.floor(a/c)+math.floor(a/lcm(b,c))
    return r
a,b,c,d=(int(x) for x in input().split())
ans=numantidiv(b,c,d)-numantidiv(a-1,c,d)
print(ans)

Fixed submission:
S=input()
for i in range(3):
  if S[i]==S[i+1]:
    print("Bad")
    exit()
print("Good")
Buggy python submission (verdict: Runtime Error):
N,M=(int(x) for x in int(input().split()))
L=0
R=N
for i in range(M):
  Li,Ri=(int(x) for x in int(input().split()))
  L=Li if Li>L 
  R=Ri if Ri<R
print(Ri-Li+1)

Fixed submission:
N,M=(int(x) for x in input().split())
L=0
R=N
for i in range(M):
  Li,Ri=(int(x) for x in input().split())
  L=Li if Li>L else L
  R=Ri if Ri<R else R
ans=R-L+1 if R>=L else 0
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N,K=(int(x) for x in input().split())
ans=0
for i in range(1,N+1):
  ans+=((1/2)**math.ceil(math.log2(k*1.0/i)))/i
print(i)

Fixed submission:
import math
N,K=(int(x) for x in input().split())
ans=0.0
for i in range(1,N+1):
  c=0 if i>=K else math.ceil(math.log2(K*1.0/i))
  ans+=0.5**c
print(ans/N)
Buggy python submission (verdict: Runtime Error):
import numpy as np


def solve():
    n, x = [int(i) for i in input().split()]
    l = np.array([int(i) for i in input().split()])

    d = 0
    ans = 0
    for i in range(1, n + 2):
        d = d + l[i - 1]
        if d <= x:
            ans += 1
        else:
            break

    if l[0] < x:
        ans += 1

    print(ans)


if __name__ == '__main__':
    solve()


Fixed submission:
import numpy as np


def solve():
    n, x = [int(i) for i in input().split()]
    l = np.array([int(i) for i in input().split()])

    if x == 0:
        print(0)
        exit(0)

    d = 0
    ans = 1

    for i in range(1, n + 1):
        d = d + l[i - 1]
        if d <= x:
            ans += 1
        else:
            break

    print(ans)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import numpy as np
from pprint import pprint


def solve(MM, H, W):

    L, R, U, D = np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int)

    for i in range(H):
        i_r = H - 1 - i

        # L, U
        for j in range(W):
            j_r = W - 1 - j

            # L
            if MM[i][j]:
                if j == 0:
                    L[i][j] = 1
                else:
                    L[i][j] = L[i][j - 1] + 1

            # R
            if MM[i][j_r]:
                if j_r == W - 1:
                    R[i][j_r] = 1
                else:
                    R[i][j_r] = R[i][j_r + 1] + 1

            # U
            if MM[i][j]:
                if i == 0:
                    U[i][j] = 1
                else:
                    U[i][j] = U[i - 1][j] + 1

            # D
            if MM[i_r][j]:
                if i_r == H - 1:
                    D[i_r][j] = 1
                else:
                    D[i_r][j] = D[i_r + 1][j] + 1

    print((L + R + U + D - 3).max())


def solve2(MM, H, W):
    L, R, U, D = [MM.copy() for _ in range(4)]

    # U, D
    for i in range(1, H):
        U[i] = (U[i - 1] + 1) * MM[i]
        i_r = H - 1 - i
        D[i_r] = (D[i_r + 1] + 1) * MM[i_r]

    MM_T = MM.T
    L_T, R_T = L.T, R.T

    # L, R
    for i in range(1, W):
        L_T[i] = (L_T[i - 1] + 1) * MM_T[i]
        i_r = W - 1 - i
        R_T[i_r] = (R_T[i_r + 1] + 1) * MM_T[i_r]

    L, R = L_T.T, R_T.T
    print((L + R + U + D).max() - 3)


def stdin():
    H, W = [int(x) for x in input().split()]
    MM = np.zeros((H, W), dtype=int)

    for i in range(H):
        line = str(input())

        for j in range(W):
            if line[j] != '#':
                MM[i][j] = 1

    solve2(MM, H, W)


if __name__ == '__main__':
    stdin()


Fixed submission:
def solve():
    p, q, r = sorted([int(x) for x in input().split()])

    print(p + q)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import sys
import math


def main():
    a = int(sys.argv[1])
    p = int(sys.argv[2])
    return math.floor((a * 3 + p) / 2)


if __name__ == '__main__':
    print(main())


Fixed submission:
# -*- coding: utf-8 -*-
import math


def main():
    inp = input().split()
    a = int(inp[0])
    p = int(inp[1])
    return math.floor((a * 3 + p) / 2)


if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Runtime Error):
n,h,w=map(int,input().split())
cnt=0
for i in range(n):
  a,b=map(int,input().split())
  cnt+=1 if a>=h and b>=w
print(cnt)

Fixed submission:
n,h,w=map(int,input().split())
cnt=0
for i in range(n):
  a,b=map(int,input().split())
  if a>=h and b>=w:
    cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
x=int(input())
if x == 7 or x == 5 or x == 3:
	print('YES')
else:
	print('NO')p

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=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
diff=1000000
ans=-1
for i in range(n):
    ave=t-(h[i]*0.006)
    tmp=a-ave
    if tmp < 0:
        tmp*=-1
    if diff > tmp:
        diff=tmp
        ans=i+1
print(ans)p

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
diff=1000000
for i in range(n):
    ave=t-(h[i]*0.006)
    tmp=a-ave
    if tmp < 0:
        tmp*=-1
    if diff > tmp:
        diff=tmp
        ans=i+1
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
diff=float('INF')
ans=-1
for i in range(n):
    ave=t-(h[i]*0.006)
    tmp=a-ave
    if tmp < 0:
        tmp*=-1
    if diff > tmp:
        diff=tmp
        ans=i+1
print(ans)p

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
diff=1000000
for i in range(n):
    ave=t-(h[i]*0.006)
    tmp=a-ave
    if tmp < 0:
        tmp*=-1
    if diff > tmp:
        diff=tmp
        ans=i+1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n == 1:
	print('Hello World')
else:
	a,b=map(int,input().split())
	print(a*b)

Fixed submission:
n=int(input())
if n == 1:
    print('Hello World')
if n == 2:
    a=int(input())
    b=int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=float("inf")
for i in a:
    i=bin(i).count("0")
    if ans > i :
        ans=i
print(ans)

Fixed submission:
print(input().count('1'))
Buggy python submission (verdict: Time Limit Exceeded):
from numpy import array
n = int(input()) / 2
d = array([int(i) for i in input().split()])

c = 0
b = 0
for i in sorted(d):
    if sum(d < i) == n:
        c += i - b
    b = i
print(c)


Fixed submission:
N = int(input())
ds = sorted([int(i) for i in input().split()])

print(ds[N//2] - ds[N//2 - 1])
Buggy python submission (verdict: Runtime Error):
import scipy.special

def combination(n,r):
    return scipy.special.comb(n,r,exact=True)

mod=10**9+7
N,K=map(int,input().split())
B=K
R=N-K

for i in range(1,K+1):
    print(combination(R+1,i)*combination(B-1,i-1)%mod)

Fixed submission:
from scipy.misc import comb

mod=10**9+7
N,K=map(int,input().split())
B=K
R=N-K

for i in range(1,K+1):
    print(comb(R+1,i,exact=True)*comb(B-1,i-1,exact=True)%mod)
Buggy python submission (verdict: Runtime Error):
N, L= map(int, input().split())
if L<0 and L+N-1>0:
    print(int((2*L+N-1)*N/2))
elif L>0:
    print(int((2*L+N)*(N-1)/2))
else:
    print(int((2*L+N-2)*(N-1)/2))

Fixed submission:
a=int(input())
b=a%10
c=(a-b)/10
judg="Good"
for i in range(3):
    if b==c%10:
        judg="Bad"
    else:
        b=c%10
        c=(c-b)/10
print(judg)

Buggy python submission (verdict: Runtime Error):
N, L= map(int, input().split())
if L<0 and L+N-1>0:
    print(int((2*L+N-1)*N/2))
elif L>0:
    print(int((2*L+N)*(N-1)/2))
else:
    print(int((2*L+N-2)*(N-1)/2))

Fixed submission:
a=int(input())
b=a%10
c=(a-b)/10
judg="Good"
for i in range(3):
    if b==c%10:
        judg="Bad"
    else:
        b=c%10
        c=(c-b)/10
print(judg)

Buggy python submission (verdict: Runtime Error):
a = map(int,input())
b=a%10
c=(a-b)/10
judg="Good"
for i in range(4):
    if b==c%10:
        judg="Bad"
    else:
        b=c%10
        c=(c-b)/10
print(judg)

Fixed submission:
a=int(input())
b=a%10
c=(a-b)/10
judg="Good"
for i in range(3):
    if b==c%10:
        judg="Bad"
    else:
        b=c%10
        c=(c-b)/10
print(judg)

Buggy python submission (verdict: Runtime Error):
a = map(int,input().split())
b=a%10
c=(a-b)/10
judg="Good"
for i in range(4):
    if b==c%10:
        judg="Bad"
    else:
        b=c%10
        c=(c-b)/10
print(judg)

Fixed submission:
a=int(input())
b=a%10
c=(a-b)/10
judg="Good"
for i in range(3):
    if b==c%10:
        judg="Bad"
    else:
        b=c%10
        c=(c-b)/10
print(judg)
Buggy python submission (verdict: Runtime Error):
X, A = map(int, input().split())

if X<A:
  return 0
else:
  return10

Fixed submission:
X, A = map(int, input().split())
 
if X<A:
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
if X<A:
  return 0
else:
  return10

Fixed submission:
X, A = map(int, input().split())
 
if X<A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
import math
import functools


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


N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
res = functools.reduce(lcm, T)
print(res)


Fixed submission:
import fractions
import functools


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


N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
res = functools.reduce(lcm, T)
print(res)
Buggy python submission (verdict: Runtime Error):
from math import factorial


class Frac(object):
    def __init__(self, a, b):
        self.a = a
        self.b = b

    def eq(self, f):
        return self.a * f.b == f.a * self.b

    def lt(self, f):
        return self.a * f.b > f.a * self.b

    def __repr__(self):
        return '%.6f' % (self.a / self.b)


def nCr(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)


N, A, B = map(int, input().split())
V = list(map(int, input().split()))
V.sort(reverse=True)

res = None
for i in range(A, B+1):
    now = Frac(sum(V[:i]), i)
    if res is None or now.lt(res[0]):
        res = [now]
    elif now.eq(res[0]):
        res.append(now)

cnt = 0
for now in res:
    p = V[:now.b]
    n = len(list(filter(lambda x: x == p[-1], V)))
    r = len(list(filter(lambda x: x == p[-1], p)))
    cnt += nCr(n, r)

print(res[0])
print(cnt)
~

Fixed submission:
class Frac(object):
    def __init__(self, a, b):
        self.a = a
        self.b = b

    def eq(self, f):
        return self.a * f.b == f.a * self.b

    def lt(self, f):
        return self.a * f.b > f.a * self.b

    def __repr__(self):
        return '%.6f' % (self.a / self.b)


def factorial(n):
    res = 1
    for i in range(n):
        res *= i+1
    return res


def nCr(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)


N, A, B = map(int, input().split())
V = list(map(int, input().split()))
V.sort(reverse=True)

res = None
for i in range(A, B+1):
    now = Frac(sum(V[:i]), i)
    if res is None or now.lt(res[0]):
        res = [now]
    elif now.eq(res[0]):
        res.append(now)

cnt = 0
for now in res:
    p = V[:now.b]
    n = len(list(filter(lambda x: x == p[-1], V)))
    r = len(list(filter(lambda x: x == p[-1], p)))
    cnt += nCr(n, r)

print(res[0])
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math

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

num_C_baisu = B//C - (A-1)//C #(math.ceil(A/C) - 1)

num_D_baisu = B//D - (A-1)//D #(math.ceil(A/D) - 1)

CD = int(C*D/math.gcd(C,D))

num_CD_baisu = B//CD - (A-1)//CD #(math.ceil(A/CD) - 1)

baisu_num = num_C_baisu + num_D_baisu - num_CD_baisu

print(B-A+1-baisu_num)

Fixed submission:
a,b,c,d= list(input())

if a==b:
    print('Bad')
elif b==c:
    print('Bad')
elif c==d:
    print('Bad')
else:
    print('Good')

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

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

num_C_baisu = (B//C - math.ceil(A/C)) + 1

num_D_baisu = (B//D - math.ceil(A/D)) + 1

CD = int(C*D/math.gcd(C,D))

num_CD_baisu = (B//CD - math.ceil(A/CD)) + 1

baisu_num = num_C_baisu + num_D_baisu - num_CD_baisu

print(B-A+1-baisu_num)

Fixed submission:
a,b,c,d= list(input())

if a==b:
    print('Bad')
elif b==c:
    print('Bad')
elif c==d:
    print('Bad')
else:
    print('Good')
Buggy python submission (verdict: Time Limit Exceeded):
def common_multiple(x, y):
    for i in range(2, min(x, y)+1):
        if x % i == 0 and y % i == 0:
            return common_multiple(x // i, y // i) * i
    return x * y

a = input().split(" ")
A, B, C, D = int(a[0]) - 1, int(a[1]), int(a[2]), int(a[3])

M = common_multiple(C, D)
B0 = B // C + B // D - B // M
A0 = A // C + A // D - A // M
print(B - A - B0 + A0)


Fixed submission:
def common_multiple(x, y):
    for i in range(2, min(x, y)+1):
        mod_x = x % i
        mod_y = y % i
        if (mod_x == 0 and mod_y == 0):
            return common_multiple(x // i, y // i) * i
        if (mod_x == 0):
            return common_multiple(x // i, y) * i
        if (mod_y == 0):
            return common_multiple(x, y // i) * i
    return  x * y

a = input().split(" ")
A,B,C,D=int(a[0]) - 1,int(a[1]),int(a[2]),int(a[3])

M = common_multiple(C,D)
B0 = B // C + B // D - B // M
A0 = A // C + A // D - A // M
print(B - A - B0 + A0)

Buggy python submission (verdict: Runtime Error):
def common_multiple(x, y):
    for i in range(2, min(x, y)+1):
        mod_x, mod_y = x % i, y % i
        if mod_x != 0 and mod_y != 0:
            next
        x0 = x // i if (mod_x == 0) else x
        y0 = y // i if (mod_y == 0) else y
        return common_multiple(x0, y0) * i
    return x * y


a = input().split(" ")
A, B, C, D = int(a[0]) - 1, int(a[1]), int(a[2]), int(a[3])

M = common_multiple(C, D)
B0 = B // C + B // D - B // M
A0 = A // C + A // D - A // M
print(B - A - B0 + A0)


Fixed submission:
def common_multiple(x, y):
    for i in range(2, min(x, y)+1):
        mod_x = x % i
        mod_y = y % i
        if (mod_x == 0 and mod_y == 0):
            return common_multiple(x // i, y // i) * i
        if (mod_x == 0):
            return common_multiple(x // i, y) * i
        if (mod_y == 0):
            return common_multiple(x, y // i) * i
    return  x * y

a = input().split(" ")
A,B,C,D=int(a[0]) - 1,int(a[1]),int(a[2]),int(a[3])

M = common_multiple(C,D)
B0 = B // C + B // D - B // M
A0 = A // C + A // D - A // M
print(B - A - B0 + A0)
Buggy python submission (verdict: Runtime Error):
n=list(map(int, input().strip().split()))

lis1=[]
for i in range(0,len(n)):
    for a in range(0,len(n)):
        if n[i]!=n[a]:
            z=(int(n[a])+int(n[i]))
            lis1.append(str(z))

minscore='9999999999'
for i in range(0,len(n)):
    if float(minscore)>float(lis1[i]):
        minscore=lis1[i]

print(minscore)



Fixed submission:
try:
    n=list(map(int, input().strip().split()))
    lis1=[]
    for i in range(0,len(n)):
        for a in range(0,len(n)):
            if a!=i:
                z=(int(n[a])+int(n[i]))
                lis1.append(z)
            
    minscore='9999999999'
    for i in range(0,len(lis1)):
        if float(minscore)>float(lis1[i]):
            minscore=lis1[i]
    
    print(minscore)
    
except:
    print('')

Buggy python submission (verdict: Runtime Error):
n=list(map(int, input().split()))

lis1=[]
for i in range(0,len(n)):
    for a in range(0,len(n)):
        if n[i]!=n[a]:
            z=(int(n[a])+int(n[i]))
            lis1.append(str(z))
minscore='9999999999'
for i in range(0,len(n)):
    if float(minscore)>float(lis1[i]):
        minscore=lis1[i]

print(minscore)



Fixed submission:
try:
    n=list(map(int, input().strip().split()))
    lis1=[]
    for i in range(0,len(n)):
        for a in range(0,len(n)):
            if a!=i:
                z=(int(n[a])+int(n[i]))
                lis1.append(z)
            
    minscore='9999999999'
    for i in range(0,len(lis1)):
        if float(minscore)>float(lis1[i]):
            minscore=lis1[i]
    
    print(minscore)
    
except:
    print('')

Buggy python submission (verdict: Runtime Error):
n=list(map(int, input().strip().split()))

lis1=[]
for i in range(0,len(n)):
    for a in range(0,len(n)):
        if n[i]!=n[a]:
            z=(int(n[a])+int(n[i]))
            lis1.append(str(z))
             
print(int(min(lis1)))



Fixed submission:
try:
    n=list(map(int, input().strip().split()))
    lis1=[]
    for i in range(0,len(n)):
        for a in range(0,len(n)):
            if a!=i:
                z=(int(n[a])+int(n[i]))
                lis1.append(z)
            
    minscore='9999999999'
    for i in range(0,len(lis1)):
        if float(minscore)>float(lis1[i]):
            minscore=lis1[i]
    
    print(minscore)
    
except:
    print('')

Buggy python submission (verdict: Runtime Error):
n=list(map(int, input().strip().split()))

lis1=[]
for i in range(0,len(n)):
    for a in range(0,len(n)):
        if n[i]!=n[a]:
            z=int(n[a]+n[i])
            lis1.append(str(z))
           
print(min(lis1))



Fixed submission:
try:
    n=list(map(int, input().strip().split()))
    lis1=[]
    for i in range(0,len(n)):
        for a in range(0,len(n)):
            if a!=i:
                z=(int(n[a])+int(n[i]))
                lis1.append(z)
            
    minscore='9999999999'
    for i in range(0,len(lis1)):
        if float(minscore)>float(lis1[i]):
            minscore=lis1[i]
    
    print(minscore)
    
except:
    print('')
Buggy python submission (verdict: Runtime Error):
n = int(input())
list1 = list(map(int, input().split()))
great = 9999999
for i in range(n - 1):
  temp = int(abs(sum(list1[:i + 1]) - sum(list1[i + 1:])))
  if temp < great:
    great = temp
print(samin)


Fixed submission:
n = int(input())
list1 = list(map(int, input().split()))
great = 9999999
for i in range(n - 1):
  temp = int(abs(sum(list1[:i + 1]) - sum(list1[i + 1:])))
  if temp < great:
    great = temp
print(great)
Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = [(input() + " " + str(i+1)).split() for i in range(N)]
 
lis = [k for k in lis]
 
lis.sort(key=lambda k: int(k[1]), reverse=True)
lis.sort(key=lambda k: k[0])
 
 
for j in lis:
    print(j[2])


Fixed submission:
try:
    a,p=map(int, input().split())
    assert 0<=a,p<=100
    print(((a*3)+p)//2)
except AssertionError:
    print('')

Buggy python submission (verdict: Runtime Error):
N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [k for k in list1]
 
list1.sort(key=lambda k: int(k[1]), reverse=True)
list1.sort(key=lambda k: k[0])
 
 
for i in list1:
    print(i[2])


Fixed submission:
try:
    a,p=map(int, input().split())
    assert 0<=a,p<=100
    print(((a*3)+p)//2)
except AssertionError:
    print('')

Buggy python submission (verdict: Runtime Error):
N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [a for a in lis]
 
list1.sort(key=lambda a: int(a[1]), reverse=True)
list1.sort(key=lambda a: a[0])
 
 
for i in list1:
    print(i[2])


Fixed submission:
try:
    a,p=map(int, input().split())
    assert 0<=a,p<=100
    print(((a*3)+p)//2)
except AssertionError:
    print('')

Buggy python submission (verdict: Runtime Error):
N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [a for a in lis]
 
list1.sort(key=lambda a: int(a[1]), reverse=True)
list1.sort(key=lambda a: a[0])
 
 
for i in lis:
    print(i[2])

Fixed submission:
try:
    a,p=map(int, input().split())
    assert 0<=a,p<=100
    print(((a*3)+p)//2)
except AssertionError:
    print('')
Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = [(input() + " " + str(i+1)).split() for i in range(N)]
 
lis = [k for k in lis]
 
lis.sort(key=lambda k: int(k[1]). reverse=True)
lis.sort(key=lambda k: k[0])
 
 
for i in lis:
    print(i[2])


Fixed submission:
n=int(input())
l=list()
for i in range(n):
    s,p=input().split()
    l.append([s,int(p),i+1])
l.sort(key=lambda x:(x[0],-x[1]))
[print(k) for i,j,k in l]

Buggy python submission (verdict: Runtime Error):
N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [a for a in lis]
 
list1.sort(key=lambda a: int(a[1]), reverse=True)
list1.sort(key=lambda a: a[0])
 
 
for i in list1:
    print(i[2])


Fixed submission:
n=int(input())
l=list()
for i in range(n):
    s,p=input().split()
    l.append([s,int(p),i+1])
l.sort(key=lambda x:(x[0],-x[1]))
[print(k) for i,j,k in l]
Buggy python submission (verdict: Runtime Error):
age,money=map(float, input().split())
assert 1<=age<=100 and 2<=money<=1000 and money%2==0
if age<=5:
    print('0')
elif 6<=age<=12:
    print(money/2)
else:
    print(money)



Fixed submission:
try:
    age,money=map(int, input().split())
    assert 0<=age<=100 and 2<=money<=1000 and money%2==0
    if age<=5:
        print('0')
    elif 6<=age<=12:
        print(money//2)
    else:
        print(money)
except AssertionError:
    print('')

Buggy python submission (verdict: Runtime Error):
age,money=map(int, input().split())
assert 1<=age<=100 and 2<=money<=1000 and money%2==0
if age<=5:
    print('0')
elif 6<=age<=12:
    print(money/2)
else:
    print(money)



Fixed submission:
try:
    age,money=map(int, input().split())
    assert 0<=age<=100 and 2<=money<=1000 and money%2==0
    if age<=5:
        print('0')
    elif 6<=age<=12:
        print(money//2)
    else:
        print(money)
except AssertionError:
    print('')

Buggy python submission (verdict: Runtime Error):
age,money=map(int, input().split())
assert 1<=age<=100 and 2<=b<=1000 and b%2==0
if age<=5:
    print('0')
elif 6<=age<=12:
    print(money/2)
else:
    print(money)


Fixed submission:
try:
    age,money=map(int, input().split())
    assert 0<=age<=100 and 2<=money<=1000 and money%2==0
    if age<=5:
        print('0')
    elif 6<=age<=12:
        print(money//2)
    else:
        print(money)
except AssertionError:
    print('')

Buggy python submission (verdict: Runtime Error):
age,money=map(int, input()).split()
assert 1<=age<=100 and 2<=b<=1000 and b%2==0
if age<=5:
    print('0')
elif 6<=age<=12:
    print(money/2)
else:
    print(money)


Fixed submission:
try:
    age,money=map(int, input().split())
    assert 0<=age<=100 and 2<=money<=1000 and money%2==0
    if age<=5:
        print('0')
    elif 6<=age<=12:
        print(money//2)
    else:
        print(money)
except AssertionError:
    print('')

Buggy python submission (verdict: Runtime Error):
age,money=map(int, input()).split()
assert 1<=age<=100 and 2<=b<=1000 and b%2==0
if age<=5:
	print('0')
elif 6<=age<=12:
  	print(money/2)
else:
  	print(money)


  

Fixed submission:
try:
    age,money=map(int, input().split())
    assert 0<=age<=100 and 2<=money<=1000 and money%2==0
    if age<=5:
        print('0')
    elif 6<=age<=12:
        print(money//2)
    else:
        print(money)
except AssertionError:
    print('')