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

import sys

def my_index(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

input = sys.stdin.readline
n,m = map(int, input().split())
A = list(map(int,input().split()))

for j in range(m):
    A.sort()
    b,c = map(int, input().split())
    if b <= n and A[0] <= c:
        if A[b-1] > c:
            for i in range(b):
                if i//c:
                    break
                f = i
            A[:f]=[c]*f
        else:
            A[:b]=[c]*b


print(sum(A))


### FIXED CODE ###

import sys
import heapq

input = sys.stdin.readline
n,m = map(int, input().split())
A = list(map(int,input().split()))
d = [list(map(int,input().split())) for _ in range(m)]

d.sort(key=lambda x:-x[1])
total = sum(A)
heapq.heapify(A)

for i in range(m):
    for j in range(d[i][0]):
        tmp = heapq.heappushpop(A, d[i][1])
        if tmp < d[i][1]:
                total += (d[i][1] - tmp)
        else:
            break

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

n = int(input())
print(sum(range(1, n)))


### FIXED CODE ###

n = int(input())

ans = n*(n-1)//2
print(ans)
### BUGGY CODE ###

N=int(input())
S=input()

L=[0]*9
D=[0]*100
C=0
for i in range(N-2):
    for j in range(i+1,N-1):
        s=str(S[i])+str(S[j])
        if(D[int(s)]==0):
            D[int(s)]=1
            C+=len(set(S[j+1:N]))
print(C)



### FIXED CODE ###

n = int(input())
s = input()
ans = 0
for a in range(10):
  for b in range(10):
    for c in range(10):
      a, b, c = str(a), str(b), str(c)
      a_find = s.find(a)
      if a_find == -1:
        continue
      b_find = s.find(b, a_find + 1)
      if b_find == -1:
        continue
      c_find = s.find(c, b_find + 1)
      if c_find == -1:
        continue
      ans += 1
print(ans)
### BUGGY CODE ###

n,a,b,*h=map(int,open(0).read().split());i,j=0,2**47
while j-i>1:
 k=c=(j+i)//2
 for t in h:c+=min(0,(b*k-t)//(a-b))
 if c<0:i=k
 else:j=k
print(j)

### FIXED CODE ###

n,a,b,*h=map(int,open(0).read().split())
i,j=0,-(-max(h)*n//a)
while True:
  if j-i<2:
    print(j)
    break
  k=c=(j+i+1)//2
  for t in h:
    t-=b*k
    if t>0:
      c+=-t//(a-b)
  if c>=0:
    j=k
  else:
    i=k
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))

MOD = 10**9+7

from collections import Counter

def prime(n):
    p = Counter()

    while not n % 2:
        p[2] += 1
        n //= 2
        
    i = 3
    
    while i <= n**0.5:
        while not n % i:
            p[i] += 1
            n //= i
        i += 2
        
    if n > 1: p[n] += 1
    
    return p

c = Counter()
for a in A:
    p = prime(a)

    for key, value in p.items():
        c[key] = max(c[key], value)

n = 1
for key, value in c.items():
    n *= key**value

ans = 0
for a in A:
    ans += n // a
    ans %= MOD

print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

MOD = 10**9+7
def pow(a, b):
    res = 1
    while b:
        if b & 1: res = res * a % MOD
        a = a**2 % MOD
        b >>= 1
    return res

def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = set(A)
    
    m = max(B)+1    
    prime = {i:i for i in range(m)}
    is_prime = [False] * m
    
    for i in range(2, int(m**0.5)+1):
        if is_prime[i]: continue
        is_prime[i] = True
        
        for j in range(2*i, m, i):
            if not is_prime[j]: prime[j] = i
            is_prime[j] = True
            
    from collections import Counter
    
    count = Counter()
            
    for a in A:
        c = Counter()
        while a > 1:
            n = prime[a]
            c[n] += 1
            a //= n
        for k, v in c.items(): count[k] = max(count[k], v)
            
    x = 1
    for k, v in count.items(): x = x * k**v % MOD
    
    ans = 0
    for a in A: ans += x * pow(a, MOD-2) % MOD
    
    print(ans%MOD)

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

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

ans = 1
c = a
while True:
  if c < b:
    c = c -1 + a
    ans = ans + 1
  else:
    print(ans)


### FIXED CODE ###

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

ans = 0
c = 1
while True:
  if c >= b:
    print(ans)
    break
  else:
    c = c -1 + a
    ans += 1
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 20:40:01 2019

@author: Yamazaki Kenichi
"""

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
a,b,c = [],[],[]
for i in range(X):
    a.append(A[-1] - A[-i-1])
for i in range(Y):
    b.append(B[-1] - B[-i-1])
for i in range(Z):
    c.append(C[-1] - C[-i-1])
s1,s2,s3 = X,Y,Z
#while s1*s2*s3 < K:
#    if s1 + 1 <X and a[s1+1]-a[s1] == min(a[s1+1]-a[s1],c[s3+1]-c[s3],b[s2+1]-b[s2]):
#        s1 += 1
#    elif s2 + 1 <Y and  a[s2+1]-a[s2] == min(c[s3+1]-c[s3],b[s2+1]-b[s2]):
#        s2 += 1
#    elif s3 + 1 <Z:
#        s3 += 1 
ans = []
for i in range(s1):
    for j in range(s2):
        for k in range(s3):
            ans.append(A[-i-1]+B[-j-1]+C[-k-1])
ans.sort()
for i in range(K):
    print(ans[-i-1])
    

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 22:30:07 2019

@author: Yamazaki Kenichi
"""
import heapq
#import random
#X,Y,Z,K = 1000,1000,1000,3000
#A = random.sample(range(10**9),1000)
#B = random.sample(range(10**9),1000)
#C = random.sample(range(10**9),1000)

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
Q = []
T = [[-1 for i in range(X)] for i in range(Y)]
T[0][0] = 0
heapq.heappush(Q,[-(A[0]+B[0]+C[0]),0,0,0])
for i in range(K-1):
    k = heapq.heappop(Q)
    s1,s2,s3 = k[1],k[2],k[3]
    if s1 + 1 != X and T[s1+1][s2] < s3:
        heapq.heappush(Q,[-(A[s1+1]+B[s2]+C[s3]),s1+1,s2,s3])
        T[s1+1][s2] += 1
    if s2 + 1 != Y and T[s1][s2+1] < s3:
        heapq.heappush(Q,[-(A[s1]+B[s2+1]+C[s3]),s1,s2+1,s3])
        T[s1][s2+1] += 1
    if s3 + 1 != Z and T[s1][s2] < s3 + 1:
        heapq.heappush(Q,[-(A[s1]+B[s2]+C[s3+1]),s1,s2,s3+1])
        T[s1][s2] += 1
    print(-k[0])
k = heapq.heappop(Q)
print(-k[0])
### BUGGY CODE ###

a = int(input())
ar = [int(input()) for i in range(a)]
br = sorted(ar)
for r in ar:
    if r == max(ar):
        print(br[-2])
    else:
        print(max(ar))

### FIXED CODE ###

a = int(input())
ar = [int(input()) for i in range(a)]
br = sorted(ar)
am = max(ar)
bm = br[-2]
for r in ar:
    if r == am:
        print(bm)
    else:
        print(am)
### BUGGY CODE ###

n, m = map(int, input().split())
list_PY = [ list(map(int,input().split(" "))) for _ in range(m)]
list_K = [[] for _ in range(n + 1)]

for p, y in list_PY:
    list_K[p].append(y)

for l in list_K:
    l.sort()

for p, y in list_PY:
    u = str(p)
    while True:
        if len(u) == 6:
            break
        u = "0" + u

    d = str(list_K[p].index(y) + 1)

    while True:
        if len(d) == 6:
            break
        d = "0" + d

    print(u + d)

### FIXED CODE ###

n, m = map(int, input().split())
list_PY = [ list(map(int,input().split(" "))) for i in range(m)]

for i in range(m):
    l = list_PY[i]
    l.append(i)
list_PY.sort(key=lambda x:(x[0], x[1]))

cnt = 0
k = 0
for i in range(m):
    l = list_PY[i]
    if l[0] == k:
        cnt += 1
        a = len(list(str(l[0])))
        b = "0"*(6 - a) + str(l[0])
        c = len(list(str(cnt)))
        d = "0"*(6 - c) + str(cnt)
    else:
        k = l[0]
        cnt = 1
        a = len(list(str(l[0])))
        b = "0" * (6 - a) + str(l[0])
        c = len(list(str(cnt)))
        d = "0" * (6 - c) + str(cnt)
    l.append(b+d)


list_PY.sort(key=lambda x:x[2])

for i in range(m):
    print(list_PY[i][3])
### BUGGY CODE ###

import sys
n,m=map(int,input().split())
INF=10**15
li1=[]
lin=[]
for i in range(m):
  a,b=map(int,input().split())
  if(a==1):li1.append(b)
  elif(b==1):li1.append(a)
  elif(a==n):lin.append(b)
  elif(b==n):lin.append(a)
for i in li1:
  if(i in lin):
    print("POSSIBLE")
    sys.exit()
    
print("IMPOSSIBLE")

### FIXED CODE ###

import sys
n,m=map(int,input().split())
INF=10**15
li1=set()
lin=set()
for i in range(m):
  a,b=map(int,input().split())
  if(a==1):li1.add(b)
  elif(b==1):li1.add(a)
  elif(a==n):lin.add(b)
  elif(b==n):lin.add(a)
for i in li1:
  if(i in lin):
    print("POSSIBLE")
    sys.exit()
    
print("IMPOSSIBLE")
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = [A[0]]
for i in range(1, N):
    if not(i & 1):
        ans.append(A[i])
    else:
        ans.insert(0, A[i])
if N & 1:
    print(*reversed(ans))
else:
    print(*ans)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
odd = [A[i] for i in range(0, N) if not(i & 1)]
even = [A[i] for i in range(0, N) if i & 1]
ans = []
if N & 1:
    ans.extend(reversed(odd))
    ans.extend(even)
else:
    ans.extend(reversed(even))
    ans.extend(odd)
print(*ans)
### BUGGY CODE ###

Data = []
def diff(b):
    sum1 = 0
    for d in Data:
        sum1 += abs(b-d)
    return sum1

N = int(input())
Data = list(map(int,input().split()))
for i in range(N):
    Data[i] -= (i+1) 

ans = 10**20
for d in Data:
    ans = min(ans,diff(d))
print(ans)

### FIXED CODE ###

Data = []
def diff(b):
    sum1 = 0
    for d in Data:
        sum1 += abs(b-d)
    return sum1

N = int(input())
Data = list(map(int,input().split()))
for i in range(N):
    Data[i] -= (i+1) 

Data.sort()
if N % 2 != 0:
    mid = Data[N//2]
    ans = diff(mid)
else:
    mid1 = Data[N//2-1]
    mid2 = Data[N//2]
    ans = min(diff(mid1),diff(mid2))

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

import sys
input = sys.stdin.readline

N, Q = map(int, input().split())
c = [int(i) for i in input().split()]
lr = [[int(i) for i in input().split()] for _ in range(Q)]

class SegTree:
  def __init__(self, n) :
    i = 1
    while i < n : 
      i <<= 1
    self.n = i
    self.tree = [set() for _ in range((i << 1))]

  def update(self, i, x) :
    i += self.n - 1
    self.tree[i].add(x)
    while i > 0 :
      i = (i - 1) // 2
      self.tree[i] = self.tree[i * 2 + 1] | self.tree[i * 2 + 2]

  # [l, r)
  def query(self, l, r) :
    l = l + self.n
    r = r + self.n
    s = set()
    while l < r :
      if r & 1 :
        r -= 1
        s |= self.tree[r - 1]
      if l & 1 :
        s |= self.tree[l - 1]
        l += 1
      l >>= 1
      r >>= 1
    return len(s)

ST = SegTree(N + 5)
for i in range(N) :
  ST.update(i, c[i])
 
for l, r in lr :
  print(ST.query(l - 1, r))

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, Q = map(int, input().split())
c = [int(i) for i in input().split()]
lr = [[int(i) - 1 for i in input().split()] for _ in range(Q)]

class BinaryIndexedTree() :
  def __init__(self, n) :
    self.n = n
    self.tree = [0] * (n + 1)
      
  def sum(self, i) :
    s = 0
    while i > 0 :
      s += self.tree[i]
      i -= i & -i
    return s
      
  def add(self, i, x) :
    while i <= self.n :
      self.tree[i] += x
      i += i & -i

BIT = BinaryIndexedTree(N + 5)
sch = [[i, l, r] for i, (l, r) in enumerate(lr)]
sch.sort(key=lambda x: x[2])
ret = [0] * Q
last = [-1] * (N + 1)

cur = 0
for i, l, r in sch :
  while cur <= r :
    BIT.add(cur + 1, 1)
    pos = last[c[cur]]
    if pos != -1 :
      BIT.add(pos + 1, -1)
    last[c[cur]] = cur
    cur += 1
  ret[i] = BIT.sum(r + 1) - BIT.sum(l)
for r in ret :
  print(r)
### BUGGY CODE ###

N = int(input())
nums = [i for i in range(1,N+1)]
new = nums[1:] + nums[:1]
ans = 0
for x,y in zip(nums,new):
    ans += x % y
print(ans)

### FIXED CODE ###

N = int(input())
print(N * (N-1) // 2)
### BUGGY CODE ###


def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

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

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    l = A[0]
    for a in A:
        l = lcm(l, a)
    ans = 0
    mod = int(1e9+7)
    for a in A:
        ans += (l * pow(a, mod-2, mod))%mod
        ans %= mod
    print(ans)


### FIXED CODE ###


def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

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

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    l = A[0]
    for a in A:
        l = lcm(l, a)
    ans = 0
    mod = int(1e9+7)
    for a in A:
        ans += (l * pow(a, mod-2, mod))%mod
        ans %= mod
    print(ans)
### BUGGY CODE ###

a,b,x = map(int,input().split())
k = 0

b -= b % x

while b >= a:
    b -= x
    k += 1

print(k)

### FIXED CODE ###

a,b,x = map(int,input().split())
b = b // x + 1
a = (a - 1) // x + 1
print(b - a)
### BUGGY CODE ###

import sys
import copy
n = int(input())
dist = [list(map(int,input().split())) for _ in range(n)]
e = copy.deepcopy(dist)
for k in range(n):
    for i in range(n):
        for j in range(n):
            if dist[i][j]>dist[i][k] + dist[k][j]:
                print(-1)
                sys.exit()
            if i!=j and i!=k and j!=k and dist[i][j]==dist[i][k] + dist[k][j]:
                #print(i,j,k)
                e[i][j]=float("inf")

#[print(*dist[l]) for l in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        if e[i][j]!=float("inf"):
            ans += dist[i][j]
print(ans//2)



### FIXED CODE ###

import sys
import copy
n = int(input())
dist = [list(map(int,input().split())) for _ in range(n)]
e = copy.deepcopy(dist)
for k in range(n):
    for i in range(n):
        for j in range(n):
            if dist[i][j]>dist[i][k] + dist[k][j]:
                print(-1)
                sys.exit()
            if i!=j and i!=k and j!=k and dist[i][j]==dist[i][k] + dist[k][j]:
                #print(i,j,k)
                e[i][j]=float("inf")

#[print(*dist[l]) for l in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        if e[i][j]!=float("inf"):
            ans += dist[i][j]
print(ans//2)
### BUGGY CODE ###

N = int(input())
t = a = 0
for i in range(N):
    T,A = map(int, input().split())
    for n in range(1,10**18):
        if t <= T*n and a <= A*n:
            t = T*n
            a = A*n
            break
print(t+a)

### FIXED CODE ###

N = int(input())
t = a = 1
for i in range(N):
    T, A = map(int, input().split())
    tb = (t + T - 1) // T
    ab = (a + A - 1) // A
    b = max(tb, ab)
    t = T * b
    a = A * b
print(t+a)
### BUGGY CODE ###

import math
def binary_search(arr, val, start, end):
    if start == end: 
        if arr[start] > val: 
            return start 
        else: 
            return start+1
  
    if start > end: 
    	return start 
  
    mid = (start+end)//2
    if arr[mid] < val: 
        return binary_search(arr, val, mid+1, end) 
    elif arr[mid] > val: 
        return binary_search(arr, val, start, mid-1) 
    else: 
        return mid 
n,m=[int(x) for x in input().split()]
s,v=0,[]
for x in input().split():
	x=int(x)
	s+=x
	v.append(x)
v.sort()
while (m>0):
	if (v[-1]==0):
		break
	k=v[-1]/2
	s-=math.ceil(k)
	del v[-1]
	l=binary_search(v, math.floor(k), 0, len(v)-1)
	v=v[:l]+[math.floor(k)]+v[l:]
	m-=1
print(s)

### FIXED CODE ###

#coding:utf-8
 
import heapq
 
N, M = map(int, input().split())
invA = []
for a in map(int, input().split()):
    heapq.heappush(invA, -1*a)
for m in range(M):
    heapq.heappush(invA, heapq.heappop(invA)/2)
total = -1*sum(map(int, invA))
 
print(total)
### BUGGY CODE ###

n,m = map(int,input().split())
l = []
for i in range(m):
    l.append(list(map(int,input().split())))
ls = set(range(1,n+1))
for i in l:
    ls = ls & set(range(i[0],i[1]+1))
print(len(ls))


### FIXED CODE ###

n,m = map(int,input().split())
l = []
for i in range(m):
    l.append(list(map(int,input().split())))
ans = 0
lmax = 0
rmin = float('inf')
for i in l:
    if i[0]>lmax:
        lmax = i[0]
    if i[1]<rmin:
        rmin = i[1]
if lmax <= rmin:
    ans = rmin - lmax + 1
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
mod_a = [i%(10**9 + 7) for i in a]
res = 0
for i in range(0, len(a)-1):
  for j in range(i+1, len(a)):
    res += (mod_a[i]*mod_a[j])%(10**9 + 7)
print(res%(10**9 + 7))


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
#mod_a = [i%(10**9 + 7) for i in a]
res = 0
sum_a = sum(a)
b = 0
t = 0
for i in range(0, len(a)-1):
  t = a[i]
  b += a[i]
  res += (sum_a - b)*t%(10**9 + 7)
print(res%(10**9 + 7))
### BUGGY CODE ###

from bisect import bisect_left

n,m = map(int,input().split())
a = list(map(int,input().split()))
bc = []
for _ in range(m):
	bc.append(list(map(int,input().split())))

a.sort()
bc = sorted(bc, key=lambda x:x[1])

l = [0 for _ in range(n+1)]
for i in range(1,n+1):
	l[i] = a[i-1]
for i in range(n):
	l[i+1] += l[i]
#print(a,sum(a))
#print(bc)
#print(l)
ans = l[-1]
num = 0
while True:
	if len(bc) == 0:
		break
	tmp = bc.pop()
	b = tmp[0]
	c = tmp[1]
	index = bisect_left(a,c)
	if index == 0:
		break
	if b >= index:
		ans -= l[index+num] - l[num]
		ans += index * c
		num += index
		a = a[index:]
	else:
		ans -= l[b+num] - l[num]
		ans += b * c
		a = a[b:]
		num += b

print(ans)


### FIXED CODE ###

import sys

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

    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    bc = []
    for _ in range(m):
        bc.append(list(map(int,input().split())))

    a.sort()
    a = tuple(a)

    bc.sort(key=lambda x: x[1], reverse=True)

    num = 0
    ans = 0

    for i in range(m):
        b = bc[i][0]
        c = bc[i][1]
        for j in range(num,min(num+b,n)):
            if c > a[j]:
                ans += c
            else:
                ans += a[j]

        num += b
        if num >= n:
            break

    if num < n:
        print(ans + sum(a[num:]))
    else:
        print(ans)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

def resolve():
    a, b, k = map(int, input().split())
    for i in range(a, b+1):
        if i < a+k or b-k < i:
            print(i)
resolve()

### FIXED CODE ###

def resolve():
    a, b, k = map(int, input().split())
    if a+k-1 >= b-k+1:
        for i in range(a, b+1):
            print(i)
    else:
        for i in range(a, a+k):
            print(i)
        for i in range(b-k+1, b+1):
            print(i)
resolve()
### BUGGY CODE ###

import bisect

N, M = [int(i) for i in input().split()]
alist = [int(i) for i in input().split()]
inputs = [[int(i) for i in input().split()] for _ in range(M)]

alist.sort()
inputs.sort(key=lambda x: x[1],reverse=True)

for i in inputs:
    index=bisect.bisect_left(alist, i[1])
    limit = index if index < i[0] else i[0]
    for r in range(limit):
        alist[r]=i[1]
    alist.sort()

print(sum(alist))




### FIXED CODE ###

import bisect

N, M = [int(i) for i in input().split()]
alist = [int(i) for i in input().split()]
alist.sort()
inputs = [[int(i) for i in input().split()] for j in range(M)]
inputs.sort(key=lambda x:x[1], reverse=True)

for i in range(N):
    if len(inputs) == 0:
        break
    if inputs[0][1] > alist[i]:
        alist[i] = inputs[0][1]
        inputs[0][0] -= 1
        if inputs[0][0] == 0:
            inputs.pop(0)
    else:
        break
print(sum(alist))
### BUGGY CODE ###

import bisect

def main():
  N = int(input())
  ans = 1
  lis_min = [int(input())]
  for i in range(N-1):
    a = int(input())
    index = bisect.bisect_left(lis_min, a)
    if index != 0:
      lis_min[index-1] = a
    else:
      ans += 1
      lis_min.insert(index, a)
  print(ans)
if __name__ == "__main__":
  main()
      

### FIXED CODE ###

def bisect_right_reverse(a, x):
    '''
    reverseにソートされたlist aに対してxを挿入できるidxを返す。
    xが存在する場合には一番右側のidx+1となる。
    '''
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok

def main():
  N = int(input())
  ans = 1
  lis_min = [int(input())]
  for i in range(N-1):
    a = int(input())
    index = bisect_right_reverse(lis_min, a)
    if index != len(lis_min):
      lis_min[index] = a
    else:
      ans += 1
      lis_min.append(a)
  print(ans)
if __name__ == "__main__":
  main()
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  if i==0:
    print(str(a.index(i+1)+1), end="")
  else:
    print(' '+str(a.index(i+1)+1), end="")

### FIXED CODE ###

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

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	N,T = MI()
	max_T = -1
	dish = []
	for i in range(N):
		A,B = MI()
		dish.append([A,B])
		dish.sort(key=lambda x : x[0])
		max_T = max(max_T, A)

	dp=[-1 for _ in range(T+max_T)]
	dp[0] = 0
	for i in range(N):
		for j in range(T-1, -1, -1):
			if(dp[j]>=0):
				dp[j+dish[i][0]] = max(dp[j+dish[i][0]], dp[j]+dish[i][1])
	print(max(dp))
main()

### FIXED CODE ###

import sys
import numpy as np

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	N,T = MI()
	max_T = -1
	dish = []
	for i in range(N):
		A,B = MI()
		dish.append([A,B])
		dish.sort(key=lambda x : x[0])
		max_T = max(max_T, A)

	dp=np.array([-1 for _ in range(T+max_T)])
	dp[0] = 0
	upper = 1
	for i in range(N):
		ch = (dp>=0)
		ch[T:] = False
		ch2 = np.roll(ch, dish[i][0])
		ch2[:dish[i][0]]=False
		dp[ch2] = np.maximum(dp[ch2] , dp[ch] + dish[i][1])
	print(max(dp))
main()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)


def main():
    input = sys.stdin.readline
    n, q = map(int, input().split())
    e = [list(map(int, input().split())) for _ in range(n-1)]
    p = [list(map(int, input().split())) for _ in range(q)]

    e2 = [{} for _ in range(n)]
    for ee in e:
        a, b = ee
        e2[a-1][b-1] = 1
        e2[b-1][a-1] = 1

    counters = [0 for _ in range(n)]
    for pp in p:
        counters[pp[0]-1] += pp[1]

    def dfs(x, p_sum):
        counters[x] += p_sum
        for y in e2[x]:
            del e2[y][x]
            dfs(y, counters[x])

    dfs(0, 0)
    print(*counters)


main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)


def main():
    input = sys.stdin.readline
    n, q = map(int, input().split())
    e = [list(map(int, input().split())) for _ in range(n-1)]
    p = [list(map(int, input().split())) for _ in range(q)]

    e2 = [{} for _ in range(n)]
    for ee in e:
        a, b = ee
        e2[a-1][b-1] = 1
        e2[b-1][a-1] = 1

    counters = [0 for _ in range(n)]
    for pp in p:
        counters[pp[0]-1] += pp[1]

    def dfs(x, p_sum):
        counters[x] += p_sum
        for y in e2[x]:
            del e2[y][x]
            dfs(y, counters[x])

    dfs(0, 0)
    print(*counters)


main()