Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*y//g
    x=ans
print(int(ans))


Fixed submission:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*t[i]//g
    x=ans
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
t=sorted(set(t))
t1=t[0]
if n==1:
    print(t1)
    exit()
for i in range(1,len(t)):
    t2=t[i]
    ans=t1*t2/frac.gcd(t1,t2)
    t1=ans
print(int(ans))


Fixed submission:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*t[i]//g
    x=ans
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
t=sorted(set(t))
t1=t[0]
if n==1:
    print(t1)
    exit()
for i in range(1,len(t)):
    t2=t[i]
    ans=t1*t2/frac.gcd(t1,t2)
    t1=ans
print(int(ans))


Fixed submission:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*t[i]//g
    x=ans
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
t1=t[0]
for i in range(1,n):
    t2=t[i]
    ans=t1*t2/frac.gcd(t1,t2)
    t1=ans
print(int(ans))


Fixed submission:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*t[i]//g
    x=ans
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
t1=t[0]
for i in range(1,n):
    t2=t[i]
    ans=t1*t2/frac.gcd(t1,t2)
    t1=ans
print(int(ans))


Fixed submission:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*t[i]//g
    x=ans
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import fractions as frac
n=int(input())
t1=int(input())
for i in range(n-1):
    t2=int(input())
    ans=t1*t2/frac.gcd(t1,t2)
    t1=ans
print(int(ans))


Fixed submission:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*t[i]//g
    x=ans
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import fractions as frac
n=int(input())
t1=int(input())
for i in range(n-1):
    t2=int(input())
    ans=t1*t2/frac.gcd(t1,t2)
    t1=t2
print(int(ans))


Fixed submission:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*t[i]//g
    x=ans
print(int(ans))
Buggy python submission (verdict: Runtime Error):
s=input()
a=s[0]
z=s[-1]
s=[1:-1]
print(a+str(len(s))+z)

Fixed submission:
s=input()
a=s[0]
z=s[-1]
s=s[1:-1]
print(a+str(len(s))+z)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,nput().split())
print(min(a+b,a+c,b+c))

Fixed submission:
a,b,c=map(int,input().split())
print(min(a+b,a+c,b+c))
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
if a>b:
    print(0)
    exit()
elif n=1 and a!=b:
    print(0)
    exit()
print((b-a)*(n-2)+1)


Fixed submission:
n,a,b=map(int,input().split())
if a>b:
    print(0)
    exit()
elif n==1 and a!=b:
    print(0)
    exit()
print((b-a)*(n-2)+1)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
list=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    list[a]+=b
sum=0
for l in range(1,len(list)):
    sum+=list[l]
    if sum>=k:
        print(l)
        exit()


Fixed submission:
a,b,c=map(int,input().split())
if a<=c<=b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
s=""
for i in range(m):
    a,b=input().split()
    s=s+a+b
for k in range(n)
    print(s.count(str(k+1)))

Fixed submission:
n,m=map(int,input().split())
x=[0]*n
for i in range(m):
    a,b=map(int,input().split())
    x[a-1]+=1
    x[b-1]+=1
for k in range(n):
    print(x[k])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
list=[0]*11
for i in range(n):
    a,b=map(int,input().split())
    list[a]+=b
sum=0
for l in range(1,len(list)):
    sum+=list[l]
    if sum>=k:
        print(l)
        exit()


Fixed submission:
n,k=map(int,input().split())
list=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    list[a]+=b
sum=0
for l in range(1,len(list)):
    sum+=list[l]
    if sum>=k:
        print(l)
        exit()

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
list=[0]*10**5+1
for i in range(n):
    a,b=map(int,input().split())
    list[a]+=b
sum=0
for i in range(1,n+1):
    sum+=list[i]
    if sum>=k:
        print(i)
        exit()


Fixed submission:
n,k=map(int,input().split())
list=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    list[a]+=b
sum=0
for l in range(1,len(list)):
    sum+=list[l]
    if sum>=k:
        print(l)
        exit()

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=[]
dic={}
for i in range(n):
    A,B=map(int,input().split())
    if A in a:
        dic[A]+=B
    else:
        a.append(A)
        dic[A]=B
a=sorted(a)
sum=0
for i in range(len(a)):
    sum+=dic[a[i]]
    if sum>=k:
        print(a[i])
        exit()


Fixed submission:
n,k=map(int,input().split())
list=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    list[a]+=b
sum=0
for l in range(1,len(list)):
    sum+=list[l]
    if sum>=k:
        print(l)
        exit()
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
print(a[0].apper()+b[0].upper()+c[0].upper())

Fixed submission:
a,b,c=input().split()
print(a[0].upper()+b[0].upper()+c[0].upper())
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:
    print("GREATER")
elif a<b:
    print("LESS")
else:
    print("EQUAL")

Fixed submission:
a=int(input())
b=int(input())
if a>b:
    print("GREATER")
elif a<b:
    print("LESS")
else:
    print("EQUAL")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a+b>=24:
    print(a+b-24):
else:
    print(a+b)

Fixed submission:
a,b=map(int,input().split())
if a+b>=24:
    print(a+b-24)
else:
    print(a+b)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
h=[]
p=[]
def man(a,c,b,d):
    s=abs(a-b)+abs(c-d)
    return s
for i in range(n):
    h.append(list(map(int,input().split())))
for j in range(m):
    p.append(list(map(int,input().split())))
for k in range(n):
    l=float(inf)
    for v in range(m):
        x=man(h[k][0],p[v][0],h[k][1],p[v][1])
        if x<l:
            l=x
    print(l)

    

Fixed submission:
n,m=map(int,input().split())
h=[]
p=[]
def man(a,c,b,d):
    s=abs(a-c)+abs(b-d)
    return s
for i in range(n):
    h.append(list(map(int,input().split())))
for j in range(m):
    p.append(list(map(int,input().split())))
for k in range(n):
    l=float("inf")
    for v in range(m):
        x=man(h[k][0],p[v][0],h[k][1],p[v][1])
        if x<l:
            l=x
            y=v+1
    print(y)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=1
for i in range(1,n+1):
    p*=i
print(p%(10**9+7))

Fixed submission:
n=int(input())
p=1
for i in range(1,n+1):
    p=(p*i)%(10**9+7)
print(p)
Buggy python submission (verdict: Runtime Error):
s=input()
a=0
z=0
i=0
j=len(s)-1
while a==0:
    if s[i]=="a":
        a=1
    else:
        i+=1
while z==0:
    if s[j]=="z":
        z=1
    else:
        j-=1
print(j-i+1)



Fixed submission:
s=input()
a=0
z=0
i=0
j=len(s)-1
while a==0 :
    if s[i]=="A":
        a=1
    else:
        i+=1
while z==0:
    if s[j]=="Z":
        z=1
    else:
        j-=1
print(j-i+1)

Buggy python submission (verdict: Runtime Error):
s=input()
a=0
z=0
i=0
j=0
while a==0:
    if s[i]=="a":
        a=1
    else:
        i+=1
while z==0:
    if s[len(s)-1-j]=="z":
        z=1
    else:
        j+=1
print(j-i+1)

Fixed submission:
s=input()
a=0
z=0
i=0
j=len(s)-1
while a==0 :
    if s[i]=="A":
        a=1
    else:
        i+=1
while z==0:
    if s[j]=="Z":
        z=1
    else:
        j-=1
print(j-i+1)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split(,)
print(a+" "+b+" "+c)

Fixed submission:
a,b,c=input().split(",")
print(a+" "+b+" "+c)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if b=="+":
print(int(a)+int(c))
else:
print(int(a)-int(c))


Fixed submission:
a,b,c=input().split()
if b=="+":
    print(int(a)+int(c))
else:
    print(int(a)-int(c))

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

Fixed submission:
a,b,c=input().split()
if b=="+":
    print(int(a)+int(c))
else:
    print(int(a)-int(c))
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input.split()))
m=int(input())
for i in range(m):
    p,x=map(int,input().split())
    s=0
    for j in range(len(t)):
        if j==p-1:
            s+=x
        else:
            s+=t[j]
    print(s)  
        
    


Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    p,x=map(int,input().split())
    s=0
    for j in range(len(t)):
        if j==p-1:
            s+=x
        else:
            s+=t[j]
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
s=0
for i in range(a,b+1):
    if (i%x==0):
        s+=1
print(s)
        


Fixed submission:
a,b,x=map(int,input().split())
if a==0:
    s=b//x+1
else:
    s=b//x-(a-1)//x
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
s=0
for i in range(b+1):
    if (i>=a) and (i%x==0):
        s+=1
print(s)
        

Fixed submission:
a,b,x=map(int,input().split())
if a==0:
    s=b//x+1
else:
    s=b//x-(a-1)//x
print(s)
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    if i==0:
        x,y=map(int,input().split())
    else:
        t,a=map(int,input().split())
        if t==1 and a==1:
            x=max(x,y)
            y=max(x,y)
        else:
            t=t*max(int(x/t),int(y/a))
            a=a*max(int(x/t),int(y/a))
            x=t
            y=a
print(x+y)
        




Fixed submission:
n=int(input())
x=1
y=1
for i in range(n):
    t,a=map(int,input().split())
    c=max(-(-x//t),-(-y//a))
    x=t*c
    y=a*c      
print(int(x+y))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(n):
    if i==0:
        x,y=map(int,input().split())
    else:
        t,a=map(int,input().split())
        v=t
        w=a
        while v<x or w<y:
            v+=t
            w+=a
        x=v
        y=w
print(x+y)
        



Fixed submission:
n=int(input())
x=1
y=1
for i in range(n):
    t,a=map(int,input().split())
    c=max(-(-x//t),-(-y//a))
    x=t*c
    y=a*c      
print(int(x+y))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(n):
    if i==0:
        x,y=map(int,input().split())
    else:
        t,a=map(int,input().split())
        v=t
        w=a
        while t<x or a<y:
            v+=t
            w+=a
        x=v
        y=w
print(x+y)
        



Fixed submission:
n=int(input())
x=1
y=1
for i in range(n):
    t,a=map(int,input().split())
    c=max(-(-x//t),-(-y//a))
    x=t*c
    y=a*c      
print(int(x+y))

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    if i==1:
        x,y=map(int,input().split())
    else:
        t,a=map(int,input().split())
        v=t
        w=a
        while t<x or a<y:
            v+=t
            w+=a
        x=v
        y=w
print(x+y)
        

Fixed submission:
n=int(input())
x=1
y=1
for i in range(n):
    t,a=map(int,input().split())
    c=max(-(-x//t),-(-y//a))
    x=t*c
    y=a*c      
print(int(x+y))
Buggy python submission (verdict: Runtime Error):
s1=input()
s2=input()
s3=input()
x=s1[0]
s1.lstrip(x)
y=1
while y>0:
    if x=="a":
        x=s1[0]
        s1=s1[1:]
        if x=="a" and len(s1)==0:
            print("A")
            y=0
    elif x=="b":
        x=s2[0]
        s2=s2[1:]
        if x=="b" and len(s2)==0:
            print("B")
            y=0
    else:
        x=s3[0]
        s3=s3[1:]
        if x=="c" and len(s3)==0:
            print("C")
            y=0



Fixed submission:
s1=input()
s2=input()
s3=input()
x=s1[0]
s1=s1[1:]
while (len(s1)!=0 or x!="a") and (len(s2)!=0 or x!="b") and (len(s3)!=0 or x!="c") :
    if x=="a":
        x=s1[0]
        s1=s1[1:]
 
    elif x=="b":
        x=s2[0]
        s2=s2[1:]
  
    else:
        x=s3[0]
        s3=s3[1:]
    
if len(s1)==0 and x=="a":
    print("A")
elif len(s2)==0 and x=="b":
    print("B")
else:
    print("C")

Buggy python submission (verdict: Runtime Error):
s1=input()
s2=input()
s3=input()
x=s1[0]
s1.lstrip(x)
y=1
while y>0:
    if x=="a":
        x=s1[0]
        s1=s1[1:]
        if x=="a" and len(s1)==0:
            print("A")
            exit()
    elif x=="b":
        x=s2[0]
        s2=s2[1:]
        if x=="b" and len(s2)==0:
            print("B")
            exit()
    else:
        x=s3[0]
        s3=s3[1:]
        if x=="c" and len(s3)==0:
            print("C")
            exit()



Fixed submission:
s1=input()
s2=input()
s3=input()
x=s1[0]
s1=s1[1:]
while (len(s1)!=0 or x!="a") and (len(s2)!=0 or x!="b") and (len(s3)!=0 or x!="c") :
    if x=="a":
        x=s1[0]
        s1=s1[1:]
 
    elif x=="b":
        x=s2[0]
        s2=s2[1:]
  
    else:
        x=s3[0]
        s3=s3[1:]
    
if len(s1)==0 and x=="a":
    print("A")
elif len(s2)==0 and x=="b":
    print("B")
else:
    print("C")
Buggy python submission (verdict: Runtime Error):
s=input()
p=list(set(list(s)))
a=[]
for i in p:
    a.append(s.count(i))
for x in a:
    if x%2!==0:
        print("No")
        exit()
print("Yes")



Fixed submission:
s=input()
p=list(set(list(s)))
a=[]
for i in p:
    a.append(s.count(i))
for x in a:
    if x%2!=0:
        print("No")
        exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
s=input()
p=list(set(list(s)))
a=[]
for i in p
    a.append(s.count(i))
for x in a:
    if x%2!==0:
        print("No")
        exit()
print("Yes")


Fixed submission:
s=input()
p=list(set(list(s)))
a=[]
for i in p:
    a.append(s.count(i))
for x in a:
    if x%2!=0:
        print("No")
        exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
c=list(input())
s=""
for x in c:
    if x!=B:
        s+=x
    else:
        s=s[:-1]
print(s)

Fixed submission:
c=list(input())
s=""
for x in c:
    if x!="B":
        s+=x
    else:
        s=s[:-1]
print(s)

Buggy python submission (verdict: Runtime Error):
c=list(input())
s=""
for i in c:
    if i=="B" and len(s)==0:
        pass
    elif i=="B":
        del(s[-1])
    elif i=="0":
        s+="0"
    else:
        s+="1"
print(s)

Fixed submission:
c=list(input())
s=""
for x in c:
    if x!="B":
        s+=x
    else:
        s=s[:-1]
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]



def main():
    n=int(input())
    s=[]
    sn=[0 for i in range(n)]
    for i in range(n):
        a=input()
        if a in s:
            sn[s.index(a)]+=1
        else:
            s.append(a)
    maxn=max(sn)
    ans=[]
    for i in range(n):
        if sn[i]==maxn:
            ans.append(s[i])
    ans=sorted(ans)

    for i in ans:
        print(i)



if __name__ == "__main__":
    main()

Fixed submission:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]



def main():
    n=int(input())
    s=[input() for i in range(n)]
    s=sorted(s)
    s.append("")
    tempn=0
    temp=s[0]
    maxn=0
    aa=[]
    for i in range(n+1):
        if temp==s[i]:
            tempn+=1
        else:

            aa.append([s[i-1],tempn])
            maxn=max(maxn,tempn)
            tempn=1
            temp=s[i]
    aa=sorted(aa)

    for a,b in aa:
        if b==maxn:
            print(a)



if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#import sys

#input = sys.stdin.readline



def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    l=list(map(int,input().split()))
    l=sorted(l,reverse=True)
    count=0
    for i in range(n-2):
        for j in range(i+1,n-1):
            for m in range(j+1,n):
                if l[m]>abs(l[i]-l[j]):
                    count+=1
                else:
                    break

    print(count)






if __name__ == "__main__":
    main()

Fixed submission:
#import sys

#input = sys.stdin.readline

import bisect

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    l=list(map(int,input().split()))
    l=sorted(l)
 #   print(l)
    count=0
    for i in range(n-2):
        for j in range(i+1,n-1):
            a = bisect.bisect_left(l,l[i]+l[j])
#            print(a)
            count+=a-j-1

    print(count)






if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#import sys

#input = sys.stdin.readline



def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    l=list(map(int,input().split()))
    count=0
    for i in range(n-2):
        for j in range(i+1,n-1):
            for m in range(j+1,n):
                if l[m]<l[i]+l[j] and l[m]>abs(l[i]-l[j]):
                    count+=1
                
    print(count)






if __name__ == "__main__":
    main()

Fixed submission:
#import sys

#input = sys.stdin.readline

import bisect

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    l=list(map(int,input().split()))
    l=sorted(l)
 #   print(l)
    count=0
    for i in range(n-2):
        for j in range(i+1,n-1):
            a = bisect.bisect_left(l,l[i]+l[j])
#            print(a)
            count+=a-j-1

    print(count)






if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#import sys

#input = sys.stdin.readline

import heapq

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    a = list(map(int,input().split()))
    b=[]
    for i in range(n):
        b.append([a[i],i+1])
#    print(b)
    heapq.heapify(b)
#    print(heapq.heappop(b))
#    print(b)
    #b=sorted(b,key=lambda x: x[1])
    c=""
 #   print(b)
    for i in range(n):
        d=heapq.heappop(b)
        d=d[1]
        c=c + str(d) + " "
    c.rstrip()
    print(c)

#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()

Fixed submission:
#import sys

#input = sys.stdin.readline

import heapq

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    a = list(map(int,input().split()))
    b=[]
    for i in range(n):
        b.append([a[i],i+1])
#    print(b)
#    heapq.heapify(b)
#    print(heapq.heappop(b))
#    print(b)
    b=sorted(b,key=lambda x: x[0])
    for i in range(n):
        print(b[i][1], end=" ")


#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#import sys

#input = sys.stdin.readline

#import heapq

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    a = list(map(int,input().split()))
    b=[]
    for i in range(n):
        b.append([i+1,a[i]])
    b=sorted(b,key=lambda x: x[1])
    c=""
 #   print(b)
    for i in range(n):
        c=c + str(b[i][0]) + " "
    c.rstrip()
    print(c)

#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()

Fixed submission:
#import sys

#input = sys.stdin.readline

import heapq

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    a = list(map(int,input().split()))
    b=[]
    for i in range(n):
        b.append([a[i],i+1])
#    print(b)
#    heapq.heapify(b)
#    print(heapq.heappop(b))
#    print(b)
    b=sorted(b,key=lambda x: x[0])
    for i in range(n):
        print(b[i][1], end=" ")


#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
rcount=0
lcount=0
for i in range(n-1):
  for j in range(i+1,n):
    if a[i]>a[j]:
      rcount+=1

for i in range(n-1):
  for j in range(i+1,n):
    if a[i]<a[j]:
      lcount+=1

#print(count,countlast)
mod=10**9+7

print((k*(k+1)*rcount+k*(k-1)*lcountlast)/2%mod)



Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
rcount=0
lcount=0
for i in range(n-1):
  for j in range(i+1,n):
    if a[i]>a[j]:
      rcount+=1

for i in range(n-1):
  for j in range(i+1,n):
    if a[i]<a[j]:
      lcount+=1

mod=10**9+7

print((k*(k+1)*rcount+k*(k-1)*lcount)//2%mod)
Buggy python submission (verdict: Runtime Error):
a, b =map(int, input().split())
c = ""
for i in range(b -a, b+a)
	c = c + str(i) + " "
print(c)

Fixed submission:
a, b =map(int, input().split())
c = ""
for i in range(b -a+1, b+a):
	c = c + str(i) + " "
print(c)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b =list(input().split())

c = 0
for i in range(a):
  if i>0:
    if (int(b[i-1]) - int(b[i])>1):
      c=1
if c==1:
  print("No")
else:
  print("Yes")

Fixed submission:
a,b,c=map(int, input().split())
if (a-b)>=c:
  print(0)
else:
  print(c-(a-b))