Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

# coding: utf-8
n = int(input())
renga_list = list(map(int, input().split()))

tmp_i = 0
i = 1
while(True):
#    print("i="+str(i))
    renga_list = renga_list[tmp_i:]
#    print("renga_list="+str(renga_list))
    if i in renga_list:
        tmp_i = renga_list.index(i)
        i += 1
    else:
        break

result = n - i + 1
if n == result:
    print(-1)
else:
    print(result)

### FIXED CODE ###

# coding: utf-8
n = int(input())
renga_list = list(map(int, input().split()))


i = 1

for renga in renga_list:
    if i == renga:
        i += 1
        
result = n - i + 1
if n == result:
    print(-1)
else:
    print(result)
### BUGGY CODE ###

n , m = map(int,input().split())
price_li = list(map(int,input().split()))
for i in range(m):
    price_li[price_li.index(max(price_li))] = max(price_li) // 2
print(sum(price_li))

### FIXED CODE ###

import heapq
n, m = map(int,input().split())
price_li = [-int(i) for i in input().split()]
heapq.heapify(price_li)
for _ in range(m):
    j = -heapq.heappop(price_li)
    j //= 2
    heapq.heappush(price_li,-j)
print(-sum(price_li))
### BUGGY CODE ###

from sys import stdin
def main():
    #入力
    readline=stdin.readline
    S=readline().strip()
    li=[0]*2019
    n=int(S)
    for i in range(len(S)):
        if i==0:
            pass
        else:
            n-=int(S[i-1])*pow(10,(len(S)-i))
        li[n%2019]+=1

    res=li[0]
    for i in range(2019):
        res+=li[i]*(li[i]-1)//2
    print(res)
    
if __name__=="__main__":
    main()

### FIXED CODE ###

from sys import stdin
def main():
    #入力
    readline=stdin.readline
    S=readline().strip()
    li=[0]*2019
    n=int(S[-1])%2019
    m=1
    for i in range(len(S)):
        if i==0:
            pass
        else:
            m*=10
            m%=2019
            l=int(S[len(S)-i-1])
            n+=m*l
            n%=2019
        li[n]+=1

    res=li[0]
    for i in range(2019):
        res+=li[i]*(li[i]-1)//2
    print(res)
    
if __name__=="__main__":
    main()
### BUGGY CODE ###

a,b,c = map(int,input().split())
n = 0
eatC = False
eatB = False
eatA = False
for i in range(a+b+c):
    if eatC:
        if b > 0:
                b -= 1
                n += 1
                eatB = True
                eatA = eatC = False
        else:
            if a > 0:
                a -= 1
                eatA = True
                eatB = eatC = False
            else:
                break
    elif eatB:
        if c > 0:
            c -= 1
            n += 1
            eatC = True
            eatA = eatB = False
        elif b > 0:
            b -= 1
            n += 1
            eatB = True
            eatA = eatC = False
        else:
            if a > 0:
                a -= 1
                eatA = True
                eatB = eatC = False
            else:
                break
    else:
        if c > 0:
            c -= 1
            n += 1
            eatC = True
            eatA = eatB = False
        else:
            if a > 0:
                a -= 1
                eatA = True
                eatC = eatB = False
            else:
                break
print(n)

### FIXED CODE ###

a,b,c = map(int,input().split())
#n = 0
if c == 0:
    n = b    
elif c > a + b:
    n = 2 * (a + b) - a + 1
else:
    n = c + (a + b) - a
print(n)
### BUGGY CODE ###

n = int(input())
x = list(map(int, input().split()))
l = sorted(x)

for i in x:
  y = l[:]
  t = y.remove(i)
  print(y[n//2-1])


### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))
l = sorted(x)

for i in x:
  if i <= l[n//2-1]:
    print(l[n//2])
  else:
    print(l[n//2-1])
### BUGGY CODE ###

import sys

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

dic = {}
for i in range(1, n+1):
    dic[i] = A[i-1]

L = [1]
tmp = 1
ct = 0
check = 0
while True:
    x = dic[tmp]
    ct += 1
    if x in L or ct > k:
        check = x
        break
    else:
        L.append(x)
        tmp = x
if ct > k:
    print(L[k])
    sys.exit()
p = L.index(check)
l = len(L)
roop = l - p
if k < p:
    print(L[k])
else:
    k -= p
    k %= roop
    print(L[p + k])

### FIXED CODE ###

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

visit = [-1] * n   #到達しているかどうかを管理

D = [1]  # 循環するもののindexを格納

tmp = A[0]  #初期位置
ct = 1

while visit[tmp - 1] == -1:
    D.append(tmp)
    visit[tmp - 1] = ct  #到達済に変更
    if k == ct:
        print(tmp)
        exit()
    ct += 1
    tmp = A[tmp - 1]

#循環している場合の残りの処理
k -= visit[tmp - 1]
k %= (ct - visit[tmp - 1])
print(D[visit[tmp - 1] + k])
### BUGGY CODE ###

n = int(input())
*a, = map(int, input().split())
print(min(abs(sum(a[:i]) - sum(a[i:])) for i in range(1, n)))

### FIXED CODE ###

n = int(input())
*a, = map(int, input().split())
s = sum(a)
ans = s
tmp = 0
for i in a[:-1]:
    tmp += i
    ans = min(ans, abs(tmp*2 - s))
print(ans)
### BUGGY CODE ###

import bisect
import math

def main():
    n = int(input())
    l_s = list(sorted(map(int, input().split(' '))))

    ans = 0

    for c in range(2, n):
        for b in range(1, c):
            idx = bisect.bisect_right(l_s[:b], l_s[c] - l_s[b])
            ans += b - idx
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import bisect
import math

def main():
    n = int(input())
    l_s = list(sorted(map(int, input().split(' '))))

    ans = 0

    for c in range(2, n):
        for b in range(1, c):
            idx = bisect.bisect_right(l_s, l_s[c] - l_s[b])
            idx = min(b, idx)
            ans += b - idx
    print(ans)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n, q = map(int, input().split())
ab = [map(int, input().split()) for _ in range(n-1)]
px = [map(int, input().split()) for _ in range(q)]

cnt = [0 for _ in range(n)]
for p, x in px:
    cnt[p-1] += x

edge = [[] for _ in range(n)]
for a, b in ab:
    edge[a-1].append(b)
    edge[b-1].append(a)


def dfs(now, bef):
    for nxt in edge[now-1]:
        if nxt != bef:
            cnt[nxt-1] += cnt[now-1]
            dfs(nxt, now)


dfs(1, -1)
print(*cnt)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)


def input(): return sys.stdin.readline()


N, Q = map(int, input().split())
ab = [[] for _ in range(N)]
for i in range(N-1):
  a, b = map(int, input().split())
  ab[a-1].append(b)
  ab[b-1].append(a)

P = [0 for _ in range(N)]
for i in range(Q):
  p, x = map(int, input().split())
  P[p-1] += x


def dfs(p, par):
  for i in ab[p-1]:
    if i != par:
      P[i-1] += P[p-1]
      dfs(i, p)


dfs(1, -12345)
print(" ".join(map(str, P)))
### BUGGY CODE ###

n=int(input())
p=1
if n<=1000:
    for i in range(1,n+1):
        p*=i
    print(p%(10**9+7))
else:
    p=641419708
    for i in range(1001,n+1):
        p*=i
    print(p%(10**9+7))


### FIXED CODE ###

n=int(input())
p=1
if n<=1000:
    for i in range(1,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)
else:
    p=641419708
    for i in range(1001,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)
### BUGGY CODE ###

from bisect import insort_left

Q = int(input())
Query = [input() for _ in range(Q)]

ans = 0
x = []
c = 0
n = 0

l, r = -float('inf'), float('inf')

for q in Query :
    if q[0] == '1' :
        a, b = map(int, q[2:].split())
        
        insort_left(x, a)
        c += b
        n += 1

        if a < l :
            ans += l - a
        elif r < a :
            ans += a - r
            
        l, r = x[(n - 1) // 2], x[n // 2]

    else :
        print(l, ans + c)


### FIXED CODE ###

import heapq

Q = int(input())
Query = [input() for _ in range(Q)]

ans = 0

lq = []
rq = []

for q in Query :
    if q[0] == '1' :
        a, b = map(int, q[2:].split())
        
        heapq.heappush(lq, -a)
        heapq.heappush(rq, a)

        lmax, rmin = -heapq.heappop(lq), heapq.heappop(rq)
        if lmax > rmin :
            lmax, rmin = rmin, lmax
            ans += rmin - lmax

        heapq.heappush(lq, -lmax)
        heapq.heappush(rq, rmin)

        ans += b

    else :
        print(-lq[0], ans)
### BUGGY CODE ###

N,M=map(int,input().split())

A=list(map(int,input().split()))
A.sort()
for w in range(M):
    A[N-1]=A[N-1]/2
    #max=A[N-1]
    
    if A[N-1]<A[N-2]:
        #A[N-1]=A[N-2]
        #A[N-2]=max
        A.sort()
    #print(A)

B=list(map(int, A))
#print(B)
print(sum(B))

### FIXED CODE ###

import heapq

N,M=map(int,input().split())
A=list(map(int,input().split()))
#print(A)
A =[-a for a in A]
#print(A)
heapq.heapify(A)

for w in range(M):
    max=heapq.heappop(A)
    heapq.heappush(A,max/2)
   
B=list(map(int, A))
#print(B)
print(sum(B)*-1)
### BUGGY CODE ###

from bisect import bisect_left
N = int(input())
A = list(map(int, input().split()))
S1 = [A[0]]*N
S2 = [A[-1]]*N
def cut(S):
    s = S[-1]/2
    i = bisect_left(S, s)
    if abs(S[i]-s) < abs(S[i-1]-s):
        return (S[i], S[-1]-S[i])
    else: return (S[i-1], S[-1]-S[i-1])
for i in range(1, N):
    S1[i] = S1[i-1]+A[i]
    S2[i] = S2[i-1]+A[N-i-1]
ans = S1[-1]
for i in range(2, N-1):
    P, Q = cut(S1[:i])
    R, S = cut(S2[:N-i])
    res = max(P, Q, R, S)-min(P, Q, R, S)
    ans = min(ans, res)
print(ans)

### FIXED CODE ###

from bisect import bisect_left
N = int(input())
A = list(map(int, input().split()))
S1 = [A[0]]*N
S2 = [A[-1]]*N
for i in range(1, N):
    S1[i] = S1[i-1]+A[i]
    S2[i] = S2[i-1]+A[N-i-1]
ans = S1[-1]
for i in range(1, N-2):
    s1 = S1[i]
    b = bisect_left(S1, s1/2)
    if abs(S1[b]-s1/2)>abs(s1/2-S1[b-1]):
        b-=1
    P, Q = S1[b], s1-S1[b]
    s2 = S2[N-i-2]
    c = bisect_left(S2, s2/2)
    if abs(S2[c]-s2/2)>abs(s2/2-S2[c-1]):
        c-=1
    R, S = S2[c], s2-S2[c]
    res = max(P, Q, R, S)-min(P, Q, R, S)
    ans = min(ans, res)
print(ans)
### BUGGY CODE ###

H, N = map(int, input().split())
Magic = [list(map(int, input().split())) for _ in range(N)]

INF = 1 << 30
dp = [INF] * (H + 1)
dp[0] = 0

for h in range(H):
	for damage, cost in Magic:
		next_index = min(h + damage, H)
		dp[next_index] = min(dp[next_index], dp[h] + cost)

print(dp[H])

### FIXED CODE ###

H, N = map(int, input().split())
A, B = [], []
for i in range(N):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)

# dp
INF = 1 << 30
dp = [INF] * (H + 1) # dp[i]: モンスターの体力を i 減らすため消耗する魔力の最小値
dp[0] = 0
for h in range(H + 1):
	for n in range(N):
		dp[h] = min(dp[h], B[n] + dp[max(h - A[n], 0)])

print(dp[H])
### BUGGY CODE ###

a, b = list(map(int, input().split()))
grid = list()
grid.append([-1 for _ in range(b + 2)])
grid.append([-1] + [1] + [0 for _ in range(b - 1)] + [-1])
for _ in range(a - 1):
    grid.append([-1] + [0 for _ in range(b)] + [-1])
grid.append([-1 for _ in range(b + 2)])
for t in range(a):
    line = list(input())
    for k in range(len(line)):
        if line[k] == '#':
            grid[t + 1][k + 1] = -1
check_list = [[1, 1]]
while len(check_list) != 0:
    new_check_list = []
    for x, y in check_list:
        if grid[x + 1][y] != -1:
            grid[x + 1][y] += 1
            new_check_list.append([x + 1, y])
        if grid[x][y + 1] != -1:
            grid[x][y + 1] += 1
            new_check_list.append([x, y + 1])
    check_list = new_check_list
print(grid[-2][-2])

### FIXED CODE ###

a, b = list(map(int, input().split()))
grid = list()
grid.append([-1 for _ in range(b + 2)])
for t in range(0, a):
    grid.append([-1])
    line = list(input())
    for k in range(len(line)):
        if line[k] == '#':
            grid[t + 1] += [-1]
        else:
            grid[t + 1] += [0]
    grid[t + 1] += [-1]
grid.append([-1 for _ in range(b + 2)])
grid[1][1] = 1
for x in range(1, a + 1):
    for y in range(1, b + 1):
        if grid[x][y] > 0:
            if grid[x + 1][y] != -1:
                grid[x + 1][y] += grid[x][y]
            if grid[x][y + 1] != -1:
                grid[x][y + 1] += grid[x][y]
print(grid[-2][-2] % (10 ** 9 + 7))
### BUGGY CODE ###

N = int(input())
a = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]
S = [0]*Q

for i, bc in enumerate(BC):
  b = bc[0]
  c = bc[1]
  a = [c if i == b else i for i in a]
  S[i] = sum(a)

[print(i) for i in S]

### FIXED CODE ###

import collections
N = int(input())
a = list(map(int, input().split()))
a_c = collections.Counter(a)
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]
s_old = 0
for k, v in a_c.items():
    s_old += k*v
for bc in BC:
  b = bc[0]
  c = bc[1]
  s = s_old
  if b in a_c:
    n = a_c.pop(b)
    a_c[c]+=n
    s-=n*b
    s+=n*c
  print(s)
  s_old = s
### BUGGY CODE ###

# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

H, W, M = map(int, input().split())
h = [] * M
w = [] * M

for _ in range(M):
    h_, w_ = map(int, input().split())
    h.append(h_)
    w.append(w_)

dic_h = Counter(h)
dic_w = Counter(w)

# print(dic_h, dic_w)
max_h_key = max(dic_h.items(), key=lambda x:x[1])[0]
max_w_key = max(dic_w.items(), key=lambda x:x[1])[0]

max_h = dic_h[max_h_key]
max_w = dic_w[max_w_key]
# print(max_h_key, max_w_key, max_h, max_w)

def get_num(ind_h, ind_w):
    ret = 0
    for i in range(M):
        if h[i] == ind_h or w[i] == ind_w:
           ret += 1
    return ret


ans = 0
for ind_h in dic_h.keys():
    if dic_h[ind_h] < max_h:
        continue
    for ind_w in dic_w.keys():
        if dic_w[ind_w] < max_w:
            continue
        ret = get_num(ind_h, ind_w)
        ans = max(ans, ret)

print(ans)






### FIXED CODE ###

# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

H, W, M = map(int, input().split())
h = [] * M
w = [] * M
dic_combi = defaultdict(int)

for _ in range(M):
    h_, w_ = map(int, input().split())
    h.append(h_)
    w.append(w_)
    dic_combi[h_ * (10**6) +  w_]=1

dic_h = Counter(h)
dic_w = Counter(w)
# print(dic_h, dic_w)
max_h_key = max(dic_h.items(), key=lambda x:x[1])[0]
max_w_key = max(dic_w.items(), key=lambda x:x[1])[0]

max_h = dic_h[max_h_key]
max_w = dic_w[max_w_key]

keys_h = [k for k, v in dic_h.items() if v == max_h]
keys_w = [k for k, v in dic_w.items() if v == max_w]


ans = 0
for ind_h in keys_h:
    for ind_w in keys_w:
        ret = max_h + max_w
        if dic_combi[ind_h*(10**6) + ind_w] == 1:
            ret -= 1
        else:
            print(ret)
            sys.exit()
        ans = max(ans, ret)

print(ans)
### BUGGY CODE ###

S=input()
Q=int(input())

for i in range(Q):
  Query=input()
  if len(Query)==1:
    S=S[::-1]
  else:
    if Query[2]=='1':
      S=S[::-1]
      S+=Query[4]
      S=S[::-1]
    else:
      S+=Query[4]

print(S)

### FIXED CODE ###

from collections import deque

S=deque(input())
Q=int(input())

t=True

for i in range(Q):
  query=input().split()
  if query[0]=='1':
    t = not t
  else:
    if (t and query[1]=='1') or (not t and query[1]=='2'):
      S.appendleft(query[2])
    else:
      S.append(query[2])

S=''.join(S)

if not t:
  S=S[::-1]

print(S)
### BUGGY CODE ###

N, u, v = map(int, input().split())
u, v = u-1, v-1
AB = [list(map(int, input().split())) for a in range(N-1)]

G = [[0 for b in range(N)] for a in range(N)]
D = [[0 for b in range(N)] for a in range(N)]

for ab in AB:
  G[ab[0]-1][ab[1]-1] = 1
  G[ab[1]-1][ab[0]-1] = 1

def dfs(current, goal, distance, prev):
  if current == goal:
    return distance
  if 0 < D[current][goal] :
    return D[current][goal]
  if 0 < D[goal][current] :
    return D[goal][current]
  dists = [0]
  for i in range(N):
    if G[current][i] == 1 and i != prev and i != current:
      dists.append(dfs(i, goal, distance + 1, current))
  D[goal][current] = max(dists)
  D[current][goal] = D[goal][current]
  return D[current][goal]

distances = [0]
for i in range(N):
  count = 0
  for j in range(N):
    if G[i][j] == 1:
      count += 1
  if count == 1:
    aoki = dfs(i, v, 0, -1)
    takahashi = dfs(i, u, 0, -1)
    if aoki > takahashi:
      distances.append(aoki)

print(max(distances)-1)


### FIXED CODE ###

from collections import deque
N, u, v = map(int, input().split())
u, v = u-1, v-1
AB = [list(map(int, input().split())) for a in range(N-1)]

G = [[] for a in range(N)]

for ab in AB:
  G[ab[0]-1].append(ab[1]-1)
  G[ab[1]-1].append(ab[0]-1)

qA = deque([v])
qT = deque([u])
costsA = [0 for a in range(N)]
doneA = [0 for a in range(N)]
costsT = [0 for a in range(N)]
doneT = [0 for a in range(N)]

doneA[v] = 1
doneT[u] = 1

def bfs(q, costs, done):
  while q:
    start = q.popleft()
    for i in G[start]:
      if done[i] == 0:
        q.append(i)
        costs[i] = costs[start] + 1
        done[i] = 1

bfs(qA, costsA, doneA)
bfs(qT, costsT, doneT)

distances = [0]
for i in range(N):
  if costsA[i] > costsT[i]:
    distances.append(costsA[i])

print(max(distances)-1)
### BUGGY CODE ###


N = int(input())

str_list = [input() for i in range(N)]

cnt_dict = {}

for str in str_list:
    s_str = "".join(sorted(str))
    if s_str not in cnt_dict.keys():
        cnt_dict[s_str] = 1
        continue
    cnt_dict[s_str] += 1

import itertools
comb = itertools.combinations

total = 0
for key in cnt_dict.keys():
    cnt = cnt_dict[key]
    if cnt < 2:
        continue
    total += len(list(comb(range(cnt), 2)))

print(total)


### FIXED CODE ###


N = int(input())

cnt_dict = {}

for i in range(N):
    s_list = list(input())
    s_list.sort()
    s_str = "".join(s_list)
    if s_str not in cnt_dict.keys():
        cnt_dict[s_str] = 1
        continue
    cnt_dict[s_str] += 1

import itertools
comb = itertools.combinations

total = 0
for key in cnt_dict.keys():
    cnt = cnt_dict[key]
    if cnt < 2:
        continue
    total += cnt * (cnt - 1) // 2

print(total)
### BUGGY CODE ###

def f(mtrx):
	maxSum = -10000000
	partSum = [0]*n
	for colStart in range(n):
		for colEnd in range(colStart,n):
			for row in range(n):
				partSum[row] = sum(mtrx[row][colStart:colEnd+1])
			calcSum = maxPart(partSum)
			maxSum = max(calcSum, maxSum)
	return maxSum

def maxPart(mtrx):
	maxSum = -10000000
	for startP in range(n):
		for endP in range(startP,n):
			calcSum = sum(mtrx[startP:endP+1])
			maxSum = max(calcSum,maxSum)
	return maxSum
	
n = int(raw_input())
mtrx = [map(int, raw_input().split()) for i in range(n)]
print f(mtrx)

### FIXED CODE ###

def x(a):
	m=-10**9
	for c in N:
		p=[0]*n 
		for e in range(c,n):
			for r in N:
				p[r]+=a[r][e]
			m=max(P(p),m)
	return m
def P(a):
	m,c=-10**5,0
	for i in N:
		c+=a[i]
		m=max(c,m)
		if c<0:c=0
	return m
n = input()
N = range(n)
print x([map(int, raw_input().split()) for i in N])
### BUGGY CODE ###

#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(N: int, M: int, a: "List[int]"):
    def gcd(a, b):
        return a if b == 0 else gcd(b, a % b)
    g = a[0]
    for v in a:
        tmp = gcd(g, v)
        g = g * v // tmp
    for v in a:
        if (g // v) % 2 == 0:
            print(0)
            return
    if M - (g // 2) < 0:
        print(0)
        return
    M -= g // 2
    ret = M // g + 1
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, a)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(N: int, M: int, a: "List[int]"):
    def gcd(a, b):
        return a if b == 0 else gcd(b, a % b)
    g = a[0]
    for v in a:
        tmp = gcd(g, v)
        g = g * v // tmp
        if M < g // 2:
            print(0)
            return
    for v in a:
        if (g // v) % 2 == 0:
            print(0)
            return
    M -= g // 2
    ret = M // g + 1
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, a)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

N = int(input())
A = []
A = input().split()
A = [int(n) for n in A]

B = [int(0) for n in range(N)]

for i in range(N) :
  B[i] = A.index(i+1) + 1


#print('N', N)
#print('A', A)
#print('B', B)

B = [str(n) for n in B]

result = ' '.join(B)

print(result)


### FIXED CODE ###

N = int(input())
A = []
A = input().split()
A = [int(n) for n in A]

B = [int(0) for n in range(N)]

for i in range(N) :
  B[A[i]-1] = i+1
#  B[i] = A.index(i+1) + 1


#print('N', N)
#print('A', A)
#print('B', B)

B = [str(n) for n in B]

result = ' '.join(B)

print(result)
### BUGGY CODE ###

def main():
    import sys
    input = sys.stdin.readline

    n = int(input())
    l = list(map(int,input().split()))
    ans = []
    for i in l:
        ans.append(i)
        ans = ans[::-1]
    print(*ans)
if __name__ == "__main__":
    main()


### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
if n % 2 == 0:
    ans = [l[i] for i in range(n-1,-1,-2)] + [l[i] for i in range(0,n-1,2)]
    print(*ans)
else:
    ans = [l[i] for i in range(n-1,-1,-2)] + [l[i] for i in range(1,n-1,2)]
    print(*ans)
### BUGGY CODE ###

import numpy as np

H, W, N = map(int, input().split())
si, sj = map(int, input().split())
si, sj = si - 1, sj - 1

S = input()
T = input()

# (1-based turn, 0:vertical | 1:horizontal, 0:minDiff | 1:exclusiveMaxDiff)
S_bounds = np.full((N + 1, 2, 2), 0, dtype=np.int)
T_bounds = np.full((N + 1, 2, 2), 0, dtype=np.int)

VERTICAL = 0
HORIZONTAL = 1
MIN_DIFF = 0
MAX_DIFF = 1

T_bounds[0, VERTICAL, :] = si
T_bounds[0, HORIZONTAL, :] = sj

piece_remaining = True

for t in range(N):
	S_bounds[t+1] = T_bounds[t]
	if S[t] == 'U':
		S_bounds[t+1, VERTICAL, MIN_DIFF] -= 1
	elif S[t] == 'D':
		S_bounds[t+1, VERTICAL, MAX_DIFF] += 1
	elif S[t] == 'L':
		S_bounds[t+1, HORIZONTAL, MIN_DIFF] -= 1
	elif S[t] == 'R':
		S_bounds[t+1, HORIZONTAL, MAX_DIFF] += 1
	
	min_i = S_bounds[t+1, VERTICAL, MIN_DIFF]
	max_i = S_bounds[t+1, VERTICAL, MAX_DIFF]
	min_j = S_bounds[t+1, HORIZONTAL, MIN_DIFF]
	max_j = S_bounds[t+1, HORIZONTAL, MAX_DIFF]

	if min_i < 0 or H <= max_i or min_j < 0 or W <= max_j:
		piece_remaining = False
		break

	T_bounds[t+1] = S_bounds[t+1]
	if T[t] == 'U':
		T_bounds[t+1, VERTICAL, MAX_DIFF] = max(0, S_bounds[t+1, VERTICAL, MAX_DIFF] - 1)
	elif T[t] == 'D':
		T_bounds[t+1, VERTICAL, MIN_DIFF] = min(H - 1, S_bounds[t+1, VERTICAL, MIN_DIFF] + 1)
	elif T[t] == 'L':
		T_bounds[t+1, HORIZONTAL, MAX_DIFF] = max(0, S_bounds[t+1, HORIZONTAL, MAX_DIFF] - 1)
	elif T[t] == 'R':
		T_bounds[t+1, HORIZONTAL, MIN_DIFF] = min(W - 1, S_bounds[t+1, HORIZONTAL, MIN_DIFF] + 1)

	min_i = T_bounds[t+1, VERTICAL, MIN_DIFF]
	max_i = T_bounds[t+1, VERTICAL, MAX_DIFF]
	min_j = T_bounds[t+1, HORIZONTAL, MIN_DIFF]
	max_j = T_bounds[t+1, HORIZONTAL, MAX_DIFF]

print('YES' if piece_remaining else 'NO')


### FIXED CODE ###

import numpy as np

H, W, N = map(int, input().split())
si, sj = map(int, input().split())
si, sj = si - 1, sj - 1

S = input()
T = input()


min_i = si
max_i = si
min_j = sj
max_j = sj

piece_remaining = True

for t in range(N):
	if S[t] == 'U':
		min_i -= 1
	elif S[t] == 'D':
		max_i += 1
	elif S[t] == 'L':
		min_j -= 1
	elif S[t] == 'R':
		max_j += 1

	if min_i < 0 or H <= max_i or min_j < 0 or W <= max_j:
		piece_remaining = False
		break

	if T[t] == 'U':
		max_i = max(0, max_i - 1)
	elif T[t] == 'D':
		min_i = min(H - 1, min_i + 1)
	elif T[t] == 'L':
		max_j = max(0, max_j - 1)
	elif T[t] == 'R':
		min_j = min(W - 1, min_j + 1)

print('YES' if piece_remaining else 'NO')