Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H,W = list(map(int,input().split()))
a = [input() for i in range(H)]

for i in range(H+2):
  if i==0 or i==H+1:
    print("#"*(W+2))
  else:
    print("#"+a[i-1]+"#")


Fixed submission:
a = list(map(int,input().split()))
b = [1,3,5,7,8,10,12]
c = [4,6,9,11]
d = [2]
e = 0

if a[0] in b and a[1] in b:
  e += 1
elif a[0] in c and a[1] in c:
  e += 1

if e == 1:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = list(1,3,5,7,8,10,12)
c = list(4,6,9,11)
d = list(2)
e = 0

if a[0] in b and a[1] in b:
  e += 1
elif a[0] in c and a[1] in c:
  e += 1

if e == 1:
  print("Yes")
else:
  print("No")

Fixed submission:
a = list(map(int,input().split()))
b = [1,3,5,7,8,10,12]
c = [4,6,9,11]
d = [2]
e = 0

if a[0] in b and a[1] in b:
  e += 1
elif a[0] in c and a[1] in c:
  e += 1

if e == 1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
z = 0

for i in range(M):
  a,b = list(map(int,input().split()))
  z.append(a)
  z.append(b)

for i in range(N):
  print(z.count(i+1))

Fixed submission:
a = list(map(int,input().split()))
b = [list(map(int,input().split())) for i in range(a[1])]
c = []

for i in range(a[0]):
  d = []
  for j in range(a[1]):
    d.append(b[j].count(i+1))
  else:
    c.append(sum(d))
else:
  for i in range(a[0]):
    print(c[i])
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
ans = ""

for n in range(N):
  a,b = input().split()
  ans+= a*int(b)

print(ans[K-1])

Fixed submission:
N,K = map(int, input().split())
s = sorted([list(map(int, input().split())) for i in range(N)])
t = 0

while K>0:
    K-=s[t][1]
    t+=1

print(s[t-1][0])
Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
s = ""

for i in range(len(o)+len(e)):
  if i%2==0:
    s+=a[i//2]
  else:
    s+=b[i//2]

print(s)


Fixed submission:
from math import floor
a = input()
b = input()
c = ""

for i in range(len(a)+len(b)):
  if i%2==0:
    c+=a[floor(0.5*i)]
  else:
    c+=b[floor(0.5*i)]
else:
  print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
x = int(n**.5)
while N%x:
  x-=1

print(len(str(N//x)))

Fixed submission:
N = int(input())
a = len(str(N))

for i in range(1,int(N**(1/2))+1):
  if N%i==0:
    a=len(str(N//i))

print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
x = int(n**.5)
while n%x:
  x-=1

print(len(str(n//x)))

Fixed submission:
N = int(input())
a = len(str(N))

for i in range(1,int(N**(1/2))+1):
  if N%i==0:
    a=len(str(N//i))

print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(n**(1/2))
a = len(str(N))

for i in range(1,k+1):
  if N%i==0:
    a=len(str(n//i))

print(a)

Fixed submission:
N = int(input())
a = len(str(N))

for i in range(1,int(N**(1/2))+1):
  if N%i==0:
    a=len(str(N//i))

print(a)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = map(int,input().split())
A = np.array([list(input()) for i in range(N)])
B = np.array([list(input()) for i in range(M)])
f = 0

for i in range(N-M+1):
  for j in range(N-M+1):
    if (A[i:i+M,j:j+M]==B).all():
      f = 1

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

Fixed submission:
import numpy as np

N,M = map(int,input().split())
A = np.array([list(input()) for _ in range(N)])
B = np.array([list(input()) for _ in range(M)])

bl = False
for i in range(N-M+1):
  for j in range(N-M+1):
    if (A[i:i+M,j:j+M] == B).all():
      bl = True

answer = 'Yes' if bl else 'No'
print(answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = list(map(int,input().split()))
M = int(input())

for i in range(N):
  P,X = list(map(int,input().split()))
  Z = T[:]
  Z[P-1] = X
  print(sum(Z))

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

for i in range(c):
  d = list(map(int,input().split()))
  e = b[:]
  e[d[0]-1] = d[1]
  print(sum(e))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
f = True

if N%2==0:
  for i in range(1,N,2):
    if A.count(i)!=2:
      f = False
else:
  for i in range(2,N,2):
    if A.count(i)!=2:
      f = False

if f:
  print(pow(2,N//2,10**9+7))
else:
  print(0)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))

if N%2==0:
  B = [2*(i//2)+1 for i in range(N)]
else:
  B = [2*(i//2) for i in range(1,N+1)]

if A==B:
  print(pow(2,N//2,10**9+7))
else:
  print(0)

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

if N%2==0:
  for i in range(1,N,2):
    if A.count(i)!=2:
      f = False
else:
  for i in range(2,N,2):
    if A.count(i)!=2:
      f = False

if f:
  print(2**(N//2))
else:
  print(0)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))

if N%2==0:
  B = [2*(i//2)+1 for i in range(N)]
else:
  B = [2*(i//2) for i in range(1,N+1)]

if A==B:
  print(pow(2,N//2,10**9+7))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
H,W = list(int,map(input().split()))
for i in range(H):
  C = input()
  print(C)
  print(C)

Fixed submission:
a = list(map(int,input().split()))
for i in range(a[0]):
  b = input()
  print(b)
  print(b)

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

for i in range(H):
  C = input()
  print(C)
  print(C)

Fixed submission:
a = list(map(int,input().split()))
for i in range(a[0]):
  b = input()
  print(b)
  print(b)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
print((a[1]-a[0]+1)//a[2])

Fixed submission:
a = input().split(" ")
print(a[0][0]+a[1][0]+a[2][0])
Buggy python submission (verdict: Runtime Error):
N = int(input())
t = 0
a = 0

for _iin range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1,(a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)

Fixed submission:
N = int(input())
t = 0
a = 0

for _ in range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1,(a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)

Buggy python submission (verdict: Runtime Error):
N = int(input())
t = 0
a = 0

for _ in range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1 (a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)

Fixed submission:
N = int(input())
t = 0
a = 0

for _ in range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1,(a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)
Buggy python submission (verdict: Runtime Error):
a = []
for i in range(4):
  a.append(int(input()))

if a[0] > a[1]:
  print(a[3]*a[1]+a[4]*(a[2]-a[1]))
else:
  print(a[3]*a[1])

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

if a <= b:
  print(a*c)
else:
  print(c*b+d*(a-b))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
a = input()
b = Counter(a)
c = 0

for i in b.values:
  if i%2!=0:
    c = 1
else:
  if c==0:
    print("Yes")
  else:
    print("No")

Fixed submission:
from collections import Counter
a = input()
b = Counter(a)
c = 0

for i in b.values():
  if i%2!=0:
    c = 1
else:
  if c==0:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Runtime Error):
from collections import Counter
a = input()
b = Counter(a)
c = 0

for i in b.values:
  if i%2!=0:
    c = 1
    break
else:
  if c==0:
    print("Yes")
  else:
    print("No")

Fixed submission:
from collections import Counter
a = input()
b = Counter(a)
c = 0

for i in b.values():
  if i%2!=0:
    c = 1
else:
  if c==0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N*(N-1)///2)

Fixed submission:
a = int(input())
print(int(0.5*a*(a+1)))
Buggy python submission (verdict: Runtime Error):
s = input()
z = []

for i in s:
  if i=="B":
    z.pop()
  else:
    z.append(i)

print("".join(z))

Fixed submission:
a = input()
b = []

for s in a:
  if s=="0" or s=="1":
    b.append(s)
  elif s=="B" and len(b)!=0:
    b.pop()
else:
  print("".join(b))

Buggy python submission (verdict: Runtime Error):
a = input()
b = []

for s in a:
  if s=="0" or s=="1":
    b.append(s)
  else:
    b.pop()
else:
  print("".join(b))

Fixed submission:
a = input()
b = []

for s in a:
  if s=="0" or s=="1":
    b.append(s)
  elif s=="B" and len(b)!=0:
    b.pop()
else:
  print("".join(b))
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = [input() for i in range(a[1])]
c = sorted(b)
print(c)

Fixed submission:
a = list(map(int,input().split()))
b = [input() for i in range(a[0])]
c = sorted(b)
print("".join(c))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
al = list(map(int, input().split()))

ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        ans += al[i]*al[j]
        ans %= 10**9+7

print(ans)

Fixed submission:
n = int(input())
al = list(map(int, input().split()))
s = sum(al)
ss = 0
m = 10**9+7
d = 500000004
for a in al:
    ss += a*a
print(((s*s-ss)%m*d)%m)
Buggy python submission (verdict: Runtime Error):
ss=input()
if ss[0] == ss[1] ==s[2] == "R":
  print(3)
elif ss[0] == s[1] == "R" or ss[1]==ss[2] == "R" or ss[2] == ss[0] == "R"
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)


Fixed submission:
ss=input()
if ss[0] == ss[1] ==ss[2] == "R":
  print(3)
elif ss[0] == ss[1] == "R" or ss[1]==ss[2] == "R":
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
ss=input()
if ss[0] == ss[1] ==s[2] = "R":
  print(3)
elif ss[0] == s[1] = "R" or ss[1]==ss[2] = "R" or ss[2] == ss[0] = "R"
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)

Fixed submission:
ss=input()
if ss[0] == ss[1] ==ss[2] == "R":
  print(3)
elif ss[0] == ss[1] == "R" or ss[1]==ss[2] == "R":
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

s = 7
i = 1
if k % 2 != 0:
    while s % k != 0:
        s += 7*10**i
        i += 1
    print(i)    
if k %2 == 0: 
    print(-1)

Fixed submission:
k = int(input())
a = 0
for i in range(k):
    a = (a*10+7)%k
    if a == 0:
        print(i+1)
        exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000 and i !== 0:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans*i
    if i == 0:
        print(0)
        ans = -1
        break
    elif ans > 1000000000000000000 and i !== 0:
        print(-1)
        ans = -1
        break
if ans != -1:
    print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans*i
    if ans > 1000000000000000000:
        print(-1)
        ans = -1
        break
if ans != -1
    print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans*i
if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)
Buggy python submission (verdict: Runtime Error):
import queue
N, M = map(int, input().split())
adj = [[] for i in range(N+1)]
parent = [-1] * (N+1)
for m in range(N):
    a, b  = map(int, input().split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue()
q.put((1,0))
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1:
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1:
            q.put((next, x))
print("Yes")
for p in parent[2:]:
    print(p)


Fixed submission:
import queue
N,M = map(int,input().split())
adj = [[]for i in range(N+1)]
parent = [-1] * (N+1) # -1なら未訪問
for m in range(M):
    a,b = map(int,input().split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue() # 自分の部屋番号、親の部屋番号
q.put((1,0)) # 部屋1の親は部屋0と考える
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1: # 訪問済み
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1: # 未訪問なら
            q.put((next,x)) # 探索候補に追加
print ('Yes') # 必ず目標は達成できる
for p in parent[2:]: # 部屋2以降の親（前の部屋）
    print(p)

Buggy python submission (verdict: Runtime Error):
import queue
N, M = map(int, input().split())
adj = [[] for i in range(N+1)]
parent = [-1] * (N+1)
for m in range(N):
    a, b  = mpa(int, input().split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue()
q.put((1,0))
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1:
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1:
            q.put((next, x))
print("Yes")
for p in parent[2:]:
    print(p)


Fixed submission:
import queue
N,M = map(int,input().split())
adj = [[]for i in range(N+1)]
parent = [-1] * (N+1) # -1なら未訪問
for m in range(M):
    a,b = map(int,input().split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue() # 自分の部屋番号、親の部屋番号
q.put((1,0)) # 部屋1の親は部屋0と考える
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1: # 訪問済み
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1: # 未訪問なら
            q.put((next,x)) # 探索候補に追加
print ('Yes') # 必ず目標は達成できる
for p in parent[2:]: # 部屋2以降の親（前の部屋）
    print(p)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int,input().split()))

min = []
for i in range(m):
    a, b = map(int, input().split())
    if h[a] < h[b]:
        min.append(a)
    if h[a] == h[b]:
        min.append(a)
        min.append(b)
    if h[a] > h[b]:
        min.append(b)

print(len(h)-len(set(min)))


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

min = []
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] < h[b-1]:
        min.append(a)
    if h[a-1] == h[b-1]:
        min.append(a)
        min.append(b)
    if h[a-1] > h[b-1]:
        min.append(b)

print(len(h)-len(set(min)))
Buggy python submission (verdict: Runtime Error):
 S,W = map(int, input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")


Fixed submission:
S,W = map(int, input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    print(A.count(i+1))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0 for i in range(N)]

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

for i in ans:
    print(i)

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

for i in range(N):
    print(A.count(i+1))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0 for i in range(N)]

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

for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd as gcd
K=int(input())

ans = 0

for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += gcd(gcd(i+1,j+1), k+1)
print(ans)


Fixed submission:
from math import gcd as gcd
K=int(input())

ans1 = 0
ans2 = 0
ans3 = 0

for i in range(K):
    for j in range(i+1,K):
        for k in range(j+1, K):
            ans1 += gcd(gcd(i+1,j+1), k+1)

for i in range(K):
    for j in range(i+1,K):
        ans2 += gcd(i+1,j+1)

for i in range(K):
    ans3+=i+1

print(ans1*6+ans2*6+ans3)

Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd as gcd
K=int(input())

ans = 0

for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += gcd(gcd(i+1,j+1), k+1)
print(ans)


Fixed submission:
from math import gcd as gcd
K=int(input())

ans1 = 0
ans2 = 0
ans3 = 0

for i in range(K):
    for j in range(i+1,K):
        for k in range(j+1, K):
            ans1 += gcd(gcd(i+1,j+1), k+1)

for i in range(K):
    for j in range(i+1,K):
        ans2 += gcd(i+1,j+1)

for i in range(K):
    ans3+=i+1

print(ans1*6+ans2*6+ans3)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
if A[m] > sum(A)/4/m:
    print("Yes")
else:
    print("No")


Fixed submission:
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
if A[m-1] >= sum(A)/4/m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
s = n
while s > 0:
    s = s-k
if s*(-1) > s+k:
    print(s+k)
else:
    print(s*(-1))


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

if n%k > k-n%k:
  print(k-n%k)
if n%k <= k-n%k:
  print(n%k)
Buggy python submission (verdict: Runtime Error):
S = input()
if S[3]==S[4] and S[5]==S[6]:
  print "Yes"
else:
  print "No"

Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math as mt
a, b, c = map(double, input().split())
if a + b + 2*mt.sqrt(a*b) < c:
  print("Yes")
else:
  print("No")


Fixed submission:
import math as mt
a, b, c = map(int, input().split())
d = c - a - b
if d>0 and d**2 > 4*a*b:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
import math as mt
a, b, c = map(int, input().split())
if a**2 + b**2 + 2*mt.sqrt(a*b) < c**2
  print("Yes")
else:
  print("No")


Fixed submission:
import math as mt
a, b, c = map(int, input().split())
d = c - a - b
if d>0 and d**2 > 4*a*b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = []
for i in range(3):
    a.append(list(map(int, input().split())))

n = int(input())
for i in range(n):
    b = int(input())
    for j in a:
        if b in j:
            a[a.index(j)][j.index(b)] = 0

ans = 0
for i in range(3):
    if a[0][i] == a[1][i] == a[2][i] == 0:
        ans = 1
    elif a[i][0] == a[i][1] == a[i][2] == 0:
        ans = 1
if a[0][0] == a[1][1] == a[2][2] == 0:
    ans = 1
if a[0][3] == a[1][1] == a[2][0] == 0:
    ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")


Fixed submission:
a = []
for i in range(3):
    a.append(list(map(int, input().split())))

n = int(input())
for i in range(n):
    b = int(input())
    for j in a:
        if b in j:
            a[a.index(j)][j.index(b)] = 0

ans = 0
for i in range(3):
    if a[0][i] == a[1][i] == a[2][i] == 0:
        ans = 1
    elif a[i][0] == a[i][1] == a[i][2] == 0:
        ans = 1
if a[0][0] == a[1][1] == a[2][2] == 0:
    ans = 1
if a[0][2] == a[1][1] == a[2][0] == 0:
    ans = 1

if ans == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ord = [i+1 for i in range(len(a))]
ans = []
for i in ord:
    ans.append(a.index(i)+1)
print(*ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ord = [0 for i in range(len(a))]
count = 1
for i in a:
    ord[i-1] = count
    count += 1
print(*ord)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(len(a)):
    for j in a:
        if i+1 == j:
            ans.append(a.index(j)+1)
print(*ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ord = [0 for i in range(len(a))]
count = 1
for i in a:
    ord[i-1] = count
    count += 1
print(*ord)
Buggy python submission (verdict: Runtime Error):
S = input()
n = len(S)//2
i = 0

if len(S)%2 == 0:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n:
        print("Yes")
else:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n and S[2*i] != "L":
        print("Yes")
    else if i ==n:
        print("No")


Fixed submission:
ss = input()
count = 0
ans  = 0
for s in ss:
    if count%2 == 0 and s != "L":
        pass
    elif count%2 == 0:
        ans += 1
    elif count%2 == 1 and s != "R":
        pass
    elif count%2 == 1:
        ans += 1
    count += 1
if ans == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = input()

n = len(S)//2
i = 0
T = "True"

while i<=n:
    if S[i] is not "L" and S[i+1] is not "R":
        i = i + 2
    else:
        print("No")
        T = "False"
        break

if T == "True":
    print("Yes")
else:
    pass


Fixed submission:
ss = input()
count = 0
ans  = 0
for s in ss:
    if count%2 == 0 and s != "L":
        pass
    elif count%2 == 0:
        ans += 1
    elif count%2 == 1 and s != "R":
        pass
    elif count%2 == 1:
        ans += 1
    count += 1
if ans == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1,n):
    ans += i
print(ans)

Fixed submission:
n = int(input())
print(int(n*(n-1)//2))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ll = [[] for _ in range(n+1)]
for i in range(n):
    ll[0].append(int(input()))

count = 1
for i in range(n):
    ll[count] = ll[0].copy()
    ll[count][count-1] = 0
    max = 0
    for j in ll[count]:
        if j>max:
            max = j
        else:
            pass
    print(max)
    count+=1


Fixed submission:
n = int(input())
ll = [int(input()) for i in range(n)]
llc = ll.copy()
llc.sort()
m1 = llc[n-1]
m2 = llc[n-2]

for l in ll:
    if l == m1:
        print(m2)
    else:
        print(m1)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ll = [0 for i in range(n+1)]
for _ in range(m):
    l, r = map(int, input().split())
    for i in range(l, r+1, 1):
        ll[i] += 1

print(ll.count(m))


Fixed submission:
n, m = map(int, input().split())
ll = [0 for i in range(n+1)]
l_max = 0
r_min = 1000000
for _ in range(m):
    l, r = map(int, input().split())
    if l > l_max :
        l_max = l
    if r < r_min:
        r_min = r
if l_max <= r_min:
    print(r_min - l_max + 1)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, n = map(int, input().split())
cnt = 0
for r in range(n+1):
    for g in range(n+1):
        bb = n - r*R - g*G
        if bb >= 0 and bb%B == 0:
            cnt += 1
print(cnt)

Fixed submission:
R, G, B, n = map(int, input().split())
cnt = 0
for r in range(n+1):
    for g in range(n+1):
        bb = n - r*R - g*G
        if bb < 0:
            break
        elif bb%B == 0:
            cnt += 1
print(cnt)