Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):

n,k = map(int,input().split())
alist = list(map(int,input().split()))

town_loop = [1]

for i in range(k):
    next_town = alist[town_loop[i]-1]

    try:
        loop_start = town_loop.index(next_town)
        break
    except ValueError:
        town_loop.append(next_town)

if len(town_loop) == k+1:
    print(town_loop[k])
else:
    o = len(town_loop) - loop_start
    print(town_loop[((k-loop_start) % o) + loop_start])


Fixed submission:

n,k = map(int,input().split())
alist = list(map(int,input().split()))

town_loop = [1]
used = [-1] * n

for i in range(k):
    next_town = alist[town_loop[i]-1]

    if used[next_town-1] == -1:
        town_loop.append(next_town)
        used[next_town-1] = 1
    else:
        break

loop_start = town_loop.index(next_town)
if len(town_loop) == k+1:
    print(town_loop[k])
else:
    o = len(town_loop) - loop_start
    print(town_loop[((k-loop_start) % o) + loop_start])

Buggy python submission (verdict: Runtime Error):

n,k = map(int,input().split())
alist = list(map(int,input().split()))

town_loop = [1]

for i in range(k):
    next_town = alist[town_loop[i]-1]

    try:
        loop_start = town_loop.index(next_town)
        break
    except ValueError:
        town_loop.append(next_town)

if len(town_loop) == k-1:
    print(town_loop[k-1])
else:
    o = len(town_loop) - loop_start
    print(town_loop[((k-loop_start) % o) + loop_start])


Fixed submission:

n,k = map(int,input().split())
alist = list(map(int,input().split()))

town_loop = [1]
used = [-1] * n

for i in range(k):
    next_town = alist[town_loop[i]-1]

    if used[next_town-1] == -1:
        town_loop.append(next_town)
        used[next_town-1] = 1
    else:
        break

loop_start = town_loop.index(next_town)
if len(town_loop) == k+1:
    print(town_loop[k])
else:
    o = len(town_loop) - loop_start
    print(town_loop[((k-loop_start) % o) + loop_start])

Buggy python submission (verdict: Runtime Error):

n,k = map(int,input().split())
alist = list(map(int,input().split()))

town_loop = [1]

for i in range(k):
    next_town = alist[town_loop[i]-1]

    try:
        loop_start = town_loop.index(next_town)
        break
    except ValueError:
        town_loop.append(next_town)
        
if len(town_loop) == k-1:
    print(town_loop[k-1])
else:
    o = len(town_loop) - loop_start
    print(town_loop[((k+1) % o) + loop_start])


Fixed submission:

n,k = map(int,input().split())
alist = list(map(int,input().split()))

town_loop = [1]
used = [-1] * n

for i in range(k):
    next_town = alist[town_loop[i]-1]

    if used[next_town-1] == -1:
        town_loop.append(next_town)
        used[next_town-1] = 1
    else:
        break

loop_start = town_loop.index(next_town)
if len(town_loop) == k+1:
    print(town_loop[k])
else:
    o = len(town_loop) - loop_start
    print(town_loop[((k-loop_start) % o) + loop_start])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
slist = []
for i in range(n):
    slist.append(input())

first_list = []
last_list = []
for i in range(n):
    s = slist[i]

    a_count = 0
    b_count = 0
    min_s = ""
    for c in s:
        if c == ")":
            b_count-=1
        else:
            b_count+=1
        if b_count < 0:
            b_count = 0
            a_count+= 1
    min_s = ")"* a_count + "("*b_count

    ai = a_count
    bi = b_count
    if bi-ai >= 0:
        first_list.append([min_s,ai])
    else:
        last_list.append([min_s,bi])

first_list= sorted(first_list, key=lambda s: s[1])
last_list= sorted(last_list, key=lambda s: s[1], reverse=True)

ans = ""
for i in range(len(first_list)):
    ans += first_list[i][0]
for i in range(len(last_list)):
    ans += last_list[i][0]

a_count = 0
b_count = 0
min_s = ""
for c in ans:
    if c == ")":
        b_count-=1
    else:
        b_count+=1
    if b_count < 0:
        b_count = 0
        a_count+= 1

if a_count == 0 and b_count == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
slist = []
for i in range(n):
    slist.append(input())

first_list = []
last_list = []
first = ""
last = ""
for i in range(n):
    s = slist[i]

    a_count = 0
    b_count = 0
    min_s = ""
    for c in s:
        if c == ")":
            b_count-=1
        else:
            b_count+=1
        if b_count < 0:
            b_count = 0
            a_count+= 1
    min_s = ")"* a_count + "("*b_count

    ai = a_count
    bi = b_count

    if ai == 0:
        first += min_s
    elif bi == 0:
        last += min_s
    elif bi-ai >= 0:
        first_list.append([min_s,ai])
    else:
        last_list.append([min_s,bi])

first_list= sorted(first_list, key=lambda s: s[1])
last_list= sorted(last_list, key=lambda s: s[1], reverse=True)

ans = first
for i in range(len(first_list)):
    ans += first_list[i][0]
for i in range(len(last_list)):
    ans += last_list[i][0]
ans += last

a_count = 0
b_count = 0
min_s = ""
for c in ans:
    if c == ")":
        b_count-=1
    else:
        b_count+=1
    if b_count < 0:
        b_count = 0
        a_count+= 1

if a_count == 0 and b_count == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
alist = list(map(int,input().split()))

count = 0
for a in range(n):
    for b in range(a+1,n):
        diff = b-a
        height_sum = alist[b]+alist[a]
        if diff == height_sum:
            count+=1
print(count)

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

a_dict = dict()
b_dict = dict()

for i in range(n):
    a = h_list[i]+i
    b = i-h_list[i]
    if not a in a_dict:
        a_dict[a] = 1
    else:
        a_dict[a] += 1
    if not b in b_dict:
        b_dict[b] = 1
    else:
        b_dict[b] += 1

count = 0
for a in a_dict:
    if a in b_dict:
        count += a_dict[a]*b_dict[a]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

ans = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
                if j - i != k - j:
                    ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()

ans = s.count("R")*s.count("G")*s.count("B")
for i in range(n):
    for j in range(i+1,n):
        k = 2*j-i
        if k < n and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
x = []
y = []
for _ in range(N):
  inp = input().split(' ')
  x += inp[0]
  y += inp[1]
x = list(map(int, x))
y = list(map(int, y))

pq = {}
for i in range(N):
  for j in range(N):
    if i == j:
      break
    
    xydif = (x[i]-x[j], y[i]-y[j])
    
    if xydif not in pq:
      pq[xydif] = 1
    else:
      pq[xydif] += 1

print(N - max(pq.values()))

Fixed submission:
input_line = input().split(' ')
N = int(input_line[0])
K = int(input_line[1])

print(N%K)
Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())
p = list(map(int,input().split()))
dic = {}
lis = []
for i in range(1,101):
    if i not in p:
        dic[i] = abs(x-i)
        lis.append(i)

mini = min(dic.values())
for j in lis:
    if mini == dic[j]:
        print(j)
        break

Fixed submission:
x,n = map(int,input().split())
p = list(map(int,input().split()))
dic = {}
lis = []
for i in range(0,102):
    if i not in p:
        dic[i] = abs(x-i)
        lis.append(i)

mini = min(dic.values())
for j in lis:
    if mini == dic[j]:
        print(j)
        break
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
a = int(a)
b = int(b*100)
print(a*b//100)

Fixed submission:
a,b = input().split()
a = int(a)
b = b[:-3] + b[-2:]
b = int(b)
print(a*b//100)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n,k = map(int,input().split())
tele = {}
a = list(map(int,input().split()))
for i in range(1,n+1):
    tele[i] = a[i-1]
lis = deque([1])
now = 1
n = 1
while tele[now] not in lis:
    lis.append(tele[now])
    now = tele[now]
p = lis.index(tele[now])
q = len(lis) - p
if k <= p:
    print(lis[k])
else:
    print(lis[(k-p)%q + p])





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

a=list(map(int,input().split()))

l=[1]
di={}
di[1]=1

for i in a:
    b=a[l[-1]-1]
    if b in di:
        x=b
        break
    l.append(b)
    di[b]=1
t1=0
for j in l:
    if j==x:
        break
    else:
        t1+=1

t2=len(l)-t1
if k<=t1:
    print(l[k])

else:
    aa=(k-t1)%t2
    print(l[t1+aa])

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n,k = map(int,input().split())
tele = {}
a = list(map(int,input().split()))
for i in range(1,n+1):
    tele[i] = a[i-1]
lis = deque([1])
now = 1
n = 1
while tele[now] not in lis:
    lis.append(tele[now])
    now = tele[now]
p = lis.index(tele[now])
q = len(lis) - p
if k <= p:
    print(lis[k])
else:
    print(lis[(k-p)%q + p])





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

a=list(map(int,input().split()))

l=[1]
di={}
di[1]=1

for i in a:
    b=a[l[-1]-1]
    if b in di:
        x=b
        break
    l.append(b)
    di[b]=1
t1=0
for j in l:
    if j==x:
        break
    else:
        t1+=1

t2=len(l)-t1
if k<=t1:
    print(l[k])

else:
    aa=(k-t1)%t2
    print(l[t1+aa])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
tele = {}
a = list(map(int,input().split()))
for i in range(1,n+1):
    tele[i] = a[i-1]
lis=[1]
now = 1
n = 1
while tele[now] not in lis:
    lis.append(tele[now])
    now = tele[now]
p = lis.index(tele[now])
q = len(lis) - p
if k <= p:
    print(lis[k])
else:
    print(lis[(k-p)%q + p])

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

a=list(map(int,input().split()))

l=[1]
di={}
di[1]=1

for i in a:
    b=a[l[-1]-1]
    if b in di:
        x=b
        break
    l.append(b)
    di[b]=1
t1=0
for j in l:
    if j==x:
        break
    else:
        t1+=1

t2=len(l)-t1
if k<=t1:
    print(l[k])

else:
    aa=(k-t1)%t2
    print(l[t1+aa])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
tele = {}
a = list(map(int,input().split()))
for i in range(1,n+1):
    tele[i] = a[i-1]
lis=[1]
now = 1
n = 1
while tele[now] not in lis:
    lis.append(tele[now])
    now = tele[now]
p = lis.index(tele[now])
q = len(lis) - p
if k <= p:
    print(lis[k])
else:
    print(lis[(k-p)%q + p])

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

a=list(map(int,input().split()))

l=[1]
di={}
di[1]=1

for i in a:
    b=a[l[-1]-1]
    if b in di:
        x=b
        break
    l.append(b)
    di[b]=1
t1=0
for j in l:
    if j==x:
        break
    else:
        t1+=1

t2=len(l)-t1
if k<=t1:
    print(l[k])

else:
    aa=(k-t1)%t2
    print(l[t1+aa])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
for i in range(1,N+1):
    print(lis.count(i))

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
dic = {}
for i in range(1,N+1):
    dic[i] = 0
for j in lis:
    dic[j] += 1
for k in range(1,N+1):
    print(dic[k])
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
cnt = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            for i in range(1,min(a,b,c)+1):
                if a%i == b%i == c%i == 0:
                    tcnt = i
            cnt += tcnt
print(cnt)

Fixed submission:
K = int(input())
ans = 0
import math

for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += math.gcd(math.gcd(a,b),c)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
cnt = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            for i in range(1,min(a,b,c)+1):
                if a%i == b%i == c%i == 0:
                    tcnt = i
            cnt += tcnt
print(cnt)

Fixed submission:
K = int(input())
ans = 0
import math

for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += math.gcd(math.gcd(a,b),c)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input())
A = (S.count("R"))*(S.count("B"))*(S.count("G"))
for i in range(1,N):
    for j in range(i+1,N+1):
        if j < 2*j - i <= N:
            if S[i-1] != S[j-1] and S[i-1] != S[2*j - i - 1] and S[j-1] != S[2*j - i - 1]:
                A -= 1
print(A)

Fixed submission:
N = int(input())
S = list(input())
A = (S.count("R"))*(S.count("B"))*(S.count("G"))
for i in range(1,N):
    for j in range(i+1,N+1):
        if j < 2*j - i <= N:
            if S[i-1] != S[j-1] and S[i-1] != S[2*j - i - 1] and S[j-1] != S[2*j - i - 1]:
                A -= 1
print(A)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M−１]*4*M < sum(score):
    print("No")
else:
    print("Yes")


Fixed submission:
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M-1]*4*M < sum(score):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M]*4*M >= sum(score):
    print("Yes")
else:
    print("No")


Fixed submission:
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M-1]*4*M < sum(score):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M]*4*M < sum(score):
    print("No")
else:
    print("Yes")


Fixed submission:
N,M = map(int,input().split())
score = list(map(int,input().split()))
score = sorted(score,reverse=True)
if score[M-1]*4*M < sum(score):
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
words = list(input())
if words[3] == words[4] and words[5]== words[6]:
    print("Yes")
else:
    print("No")

Fixed submission:
words = list(input())
if words[2] == words[3] and words[4]== words[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = list(input())
if S[0] == S[1] == S[2]:
  print("Yes)
else:
  print("No")

Fixed submission:
S = list(input())
if S[0] == S[1] == S[2]:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
for i in range(1,10**10):
    if K**i <= N < K**(i+1):
        print(i+1)
        break

Fixed submission:
N,R = map(int,input().split())
if N >= 10:
    print(R)
else:
    print(R + 100*(10 - N))
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
for i in range(1,10**10):
    if K**i <= N < K**(i+1):
        print(i+1)
        break

Fixed submission:
N,K = map(int,input().split())
if N == 0 or N == 1:
    print(1)
for i in range(1,100):
    if K**i <= N < K**(i+1):
        print(i+1)
        break

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
for i in range(1,10**10):
    if K**i <= N < K**(i+1):
        print(i+1)
        break

Fixed submission:
N,K = map(int,input().split())
if N == 0 or N == 1:
    print(1)
for i in range(1,100):
    if K**i <= N < K**(i+1):
        print(i+1)
        break

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
for i in range(1,10**9):
    if K**i <= N < K**(i+1):
        print(i+1)
    

Fixed submission:
N,K = map(int,input().split())
if N == 0 or N == 1:
    print(1)
for i in range(1,100):
    if K**i <= N < K**(i+1):
        print(i+1)
        break
Buggy python submission (verdict: Runtime Error):
N = int(input())
dic = {}
for i in range(1,N+1):
    key = input()
    if key not in dic:
        dic[key] = 1
    else:
        dic[key] += 1
lis = []
for key,val in dic.items():
    lis.append([val,key])
lis.sort(reverse = True)

lis2 = []
fnum = lis[0][0]
j = 0
while lis[j][0] == fnum:
    lis2.append(lis[j][1])
    j += 1
lis2.sort()
for k in lis2:
    print(k)
    

Fixed submission:
N = int(input())
dic = {}
for i in range(1,N+1):
    key = input()
    if key not in dic:
        dic[key] = 1
    else:
        dic[key] += 1
lis = []
for key,val in dic.items():
    lis.append([val,key])
lis.sort(reverse = True)

lis2 = []
fnum = lis[0][0]

for j in range(0,len(lis)): 
    if lis[j][0] == fnum:
        lis2.append(lis[j][1])
    else:
        break
lis2.sort()
for k in lis2:
    print(k)
Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N+1):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")

Fixed submission:
S,T = input().split()
A,B = map(int,input().split())
U = input()
if U == S:
        print(A-1,B)
else:
        print(A,B-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N+1):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
lis.sort()
judge = 0
for i in range(1,N):
    if lis[i-1] == lis[i]:
        judge = 1
if judge == 0:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
lis.sort()
judge = 0
for i in range(1,N):
    if lis[i-1] == lis[i]:
        judge = 1
if judge == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
cnt = 0
for i in range(1,N+1):
        tmp_lis = lis[0:i]
        x = min(tmp_lis)
        if lis[i-1] == x:
                cnt += 1
print(cnt)

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
cnt = 1
small = lis[0]
for i in range(2,N+1):
        if lis[i-1] <= small:
                cnt += 1
                small = lis[i-1]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
cnt = 0
for i in range(1,N+1):
        tmp_lis = lis[0:i]
        tmp_lis.sort()
        if lis[i-1] == tmp_lis[0]:
                cnt += 1
print(cnt)

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
cnt = 1
small = lis[0]
for i in range(2,N+1):
        if lis[i-1] <= small:
                cnt += 1
                small = lis[i-1]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
cnt = 0
for i in range(1,N+1):
        tmp_lis = lis[0:i]
        tmp_lis.sort()
        if lis[i-1] == tmp_lis[0]:
                cnt += 1
print(cnt)

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
cnt = 1
small = lis[0]
for i in range(2,N+1):
        if lis[i-1] <= small:
                cnt += 1
                small = lis[i-1]
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
lis =[[] for i in range(1,n+1)]
ac = 0
wa = 0
for i in range(m):
    p,s = input().split()
    p = int(p)
    if "AC" not in lis[p-1]:
        if s == "AC":
            wa += lis[p-1].count("WA")
            ac += 1
            lis[p-1].append("AC")
        else:
            lis[p-1].append("WA")
print(ac,wa)


Fixed submission:
n,m = map(int,input().split())
lis =[0 for i in range(1,n+1)]
ac = 0
wa = 0
for i in range(m):
    p,s = input().split()
    p = int(p)
    if lis[p-1] != -1:
        if s == "AC":
            wa += lis[p-1]
            ac += 1
            lis[p-1] = -1
        else:
            lis[p-1] += 1
print(ac,wa)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
cnt = 0
i = 1
while True:
        if i == N:break
        if S[i-1] == "A" and S [i] == "B" and S[i+1] == "C":
                cnt += 1
        i += 1
print(cnt)





Fixed submission:
n = int(input())
s = input()
cnt = 0
for i in range(n-2):
    if s[i:i+3] == "ABC":
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
import math
d = math.gcd(A,B)
print(A*B//d)

Fixed submission:
A,B = map(int,input().split())
import fractions
d = fractions.gcd(A,B)
print(A*B//d)

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
import math
d = math.gcd(A,B)
print(A*B//d)

Fixed submission:
A,B = map(int,input().split())
import fractions
d = fractions.gcd(A,B)
print(A*B//d)

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
import math
d = math.gcd(A,B)
print(A*B//d)

Fixed submission:
A,B = map(int,input().split())
import fractions
d = fractions.gcd(A,B)
print(A*B//d)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
for i in range(int(N**0.5),N+1):
    if N % i == 0:
        print(N//i + i - 2)
        break

Fixed submission:
N = int(input())
for i in range(int(N**0.5),0,-1):
    if N % i == 0:
        print(N//i + i - 2)
        break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
dic = {}
for i,popu in zip(range(1,N+1),lis):
    dic[i] = popu
for j in range(1,N+1):
    for k,l in dic.items():
        if l == j:
            print(k,end = " ")

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
dic = {}
for i,popu in zip(range(1,N+1),lis):
    dic[popu] = i
for j in range(1,N+1):
    print(dic[j],end = " ")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
for i in range(1,N+1):
    print(lis.index(i) + 1 ,end=" ")

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
dic = {}
for i,popu in zip(range(1,N+1),lis):
    dic[popu] = i
for j in range(1,N+1):
    print(dic[j],end = " ")