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

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

tmp = 0
for i in range(N):
    for j in range(i+1, N):
        tmp += A[i]*A[j]
print(tmp % (10**9+7))


### FIXED CODE ###

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

mem = []
h = 0
for i in range(N-1, -1, -1):
    h += A[i]
    mem.append(h)

tmp = 0
for i in range(N-1):
    tmp += A[i]*mem[-(i+1+1)]
print(tmp % (10**9+7))
### BUGGY CODE ###

import math
from collections import defaultdict


class UnionFindTree:
    def __init__(self):
        self.p = {}
        self.rank = {}

    def make(self, x):
        self.p[x] = x
        self.rank[x] = 0

    def find(self, x):
        if x in self.p:
            if self.p[x] != x:
                self.p[x] = self.find(self.p[x])
            return self.p[x]
        return None

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def unite(self, x, y):
        return self._unite(self.find(x), self.find(y))

    def _unite(self, x, y):
        if self.rank[x] < self.rank[y]:
            self.p[x] = y
            return y
        else:
            self.p[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            return x


def ncr(n, r):
    if n < r:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(M)]
ab.reverse()

utf = UnionFindTree()
for n in range(1, N + 1):
    utf.make(n)

h = {}
ans = []
total = ncr(N, 2)
for i in range(M):
    now = 0
    for k, v in h.items():
        now += ncr(v, 2)
    ans.append(total - now)

    a, b = ab[i]
    x, y = utf.find(a), utf.find(b)
    a = utf.unite(x, y)
    if x != y:
        n = h.get(x, 1) + h.get(y, 1)
        h[x] = 0
        h[y] = 0
        h[a] = n

for v in reversed(ans):
    print(v)

### FIXED CODE ###

from collections import defaultdict
from collections import deque


class UnionFindTree:
    def __init__(self):
        self.p = {}
        self.rank = {}

    def make(self, x):
        self.p[x] = x
        self.rank[x] = 0

    def find(self, x):
        if x in self.p:
            if self.p[x] != x:
                # 経路圧縮
                self.p[x] = self.find(self.p[x])
            return self.p[x]
        return None

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def unite(self, x, y):
        return self._unite(self.find(x), self.find(y))

    def _unite(self, x, y):
        if self.rank[x] < self.rank[y]:
            self.p[x] = y
            return y
        else:
            self.p[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            return x


def nc2(n):
    return (n * (n - 1)) >> 1


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

utf = UnionFindTree()
for n in range(1, N + 1):
    utf.make(n)

h = {}
ans = deque([])
total = nc2(N)
now = 0
for i in range(M):
    ans.appendleft(total)

    a, b = ab[M - i - 1]
    x, y = utf.find(a), utf.find(b)
    a = utf.unite(x, y)
    if x != y:
        nx, ny = h.get(x, 1), h.get(y, 1)
        n = nx + ny
        total += nc2(nx) + nc2(ny)
        total -= nc2(n)

        h[x] = 1
        h[y] = 1
        h[a] = n

for v in ans:
    print(v)
### BUGGY CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

def f(n):
    ret = 0
    while n>0:
        pc = format(n, 'b').count('1')
        n = n%pc
        ret += 1
    return ret

def main():
    N = int(input())
    X = list(input())
    for i in range(N):
        xi = X[:]
        if X[i]=='1':
            xi[i]='0'
        elif X[i]=='0':
            xi[i]='1'
        print(f(int(''.join(xi),2)))

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

def pc(x):
    return format(x, 'b').count('1')

N = int(input())
X = input()
Xn = int(X,2)
p = pc(Xn)
X = list(X)

Xp = Xn%(p+1)
if p==1:
    Xm = 0
else:
    Xm = Xn%(p-1)

def f(i):
    if p==1 and X[i]=='1':
        #Xi == 0 > POPcount ==0
        return 0
    else:
        if X[i]=='1':
            # p->p-1
            ret = Xm - pow(2, N-1-i, p-1)
            ret %= p-1
        else:
            # p->p+1
            ret = Xp + pow(2, N-1-i, p+1)
            ret %= p+1
        cnt = 1
        while ret > 0:
            ret %= pc(ret)
            cnt += 1
        return cnt

def main():
    for i in range(N):
        ret = f(i)
        print(ret)

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

import time
n,m=map(int,input().split())
if m>0:
  time.sleep(2.1)
else:
  if n==1:
    print(0)
  elif n==2:
    print(10)
  elif(n==3):
    print(100)

### FIXED CODE ###

n,m=map(int,input().split())
s=[]
t=[]
for i in range(m):
  u,v=input().split()
  s.append(int(u)-1)
  t.append(v)
ans=-1
for i in range(1000):
  x=str(i)
  if len(x)!=n:
    continue
  flag=True
  for j in range(m):
    if x[s[j]] != t[j]:
      flag = False
  if flag:
    ans=i
    break
print(ans)
### BUGGY CODE ###

from math import factorial


N = int(input())
count1 = [0] * (N + 1)
count2 = [0] * (N + 1)
A = list(map(int, input().split()))

B = list(set(A))

for b in B:
    num_of_b = A.count(b)
    if num_of_b > 2:
        comb = factorial(
            num_of_b) // (factorial(num_of_b - 2) * factorial(2))
        comb_minus1 = factorial(
            num_of_b - 1) // (factorial(num_of_b - 1 - 2) * factorial(2))
        count1[b] = comb
        count2[b] = comb_minus1
    elif num_of_b == 2:
        count1[b] = 1


for a in A:
    ans = 0
    ans += sum(count1) - count1[a]
    ans += count2[a]
    print(ans)


### FIXED CODE ###

from sys import stdin

N = int(stdin.readline())
a_dict = {}
A = list(map(int, stdin.readline().split()))
for a in A:
    if a in a_dict:
        a_dict[a] += 1
    else:
        a_dict[a] = 1

sum_comb = 0
B = set(A)
for b in B:
    n = a_dict[b]
    sum_comb += n * (n - 1) // 2

for a in A:
    ans = sum_comb
    n = a_dict[a]
    ans -= n * (n - 1) // 2
    ans += (n - 1) * (n - 2) // 2
    print(ans)
### BUGGY CODE ###

def main():
    n, k, c = map(int,input().split())
    s = input()
    schedule = [w == "o" for w in s]
    for i in range(n):
        if not schedule[i]:
            continue
        det(schedule,i,n,k,c)

def det(schedule,i,n,k,c):
    ins = schedule.copy()
    ins[i] = False
    count = 0
    date = 0
    for _ in range(n):
        if ins[date]:
            count += 1
            date += c
        date += 1
        if date >= n:
            break
    if count < k:
        print(i + 1)






if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n, k, c = map(int,input().split())
    s = input()
    schedule = [w == "o" for w in s]
    left = []
    l_day = 0
    right = []
    r_day = n - 1
    while len(left) < k:
        if schedule[l_day]:
            left.append(l_day)
            l_day += c
        l_day += 1

    while len(right) < k:
        if schedule[r_day]:
            right.append(r_day)
            r_day -= c
        r_day -= 1

    right.reverse()


    for i in range(k):
        if left[i] == right[i]:
            print(left[i] + 1)



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

from math import log2
N, M = map(int, input().split())
A = list(map(int, input().split()))

for i in range(M):
    A.sort()
    A[-1] = (A[-1]//2)

print(sum(A))


### FIXED CODE ###

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

h = []
for a in A:
    heapq.heappush(h, -a)

for i in range(M):
    new = heapq.heappop(h)
    new = -((-new)//2)
    heapq.heappush(h, new)

print(-sum(h))
### BUGGY CODE ###

N, K = map(int, input().split())
A = [1] + list(map(int, input().split()))

p = 1
points = [p]
for _ in range(K):
    p = A[p]
    if p in points:
        break
    points.append(p)

head = len(points[:points.index(p)])
cycle = len(points[points.index(p):])

for _ in range((K - head) % cycle):
    p = A[p]

print(p)

### FIXED CODE ###

N, K = map(int, input().split())
A = [1] + list(map(int, input().split()))

p = 1
points = [p]
visited = set([p])

for _ in range(N):
    p = A[p]
    if p in visited:
        break
    points.append(p)
    visited.add(p)

idx = points.index(p)

if idx > K:
    print(points[K])
    exit()

cycle = points[idx:]

print(cycle[(K - idx) % len(cycle)])
### BUGGY CODE ###

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

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

AmodM=[]
answer=0

for i in range(N):
  AmodM.append(A[i]%M)

for i in range(N):
  modlist=A[i]
  if modlist%M==0:
    answer+=1
  for j in range(i+1,N):
    modlist+=A[j]
    if modlist%M==0:
      answer+=1
print(answer)  

### FIXED CODE ###

import collections
import math

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

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

AmodM=[]
leftsummodM=[]
#rightsummodM=[]
#summodM=0
answer=0

for i in range(N):
  AmodM.append(A[i]%M)



leftmodcount=0
#rightmodcount=0
for i in range(N):
  leftmodcount+=AmodM[i]
  #rightmodcount+=AmodM[N-i-1]
  leftsummodM.append((leftmodcount)%M)
  #rightsummodM.append(rightmodcount)
  '''
  if leftmodcount%M==0:
    answer+=1
  if i!=N-1 and rightmodcount%M==0:
    answer+=1
  '''
count=collections.Counter(leftsummodM)

#print(count)

#0に関しては1個でも選べるので1個分多くカウントする
for k,v in count.items():
  if k==0:
    answer+=v*(v+1)//2
  else:
    answer+=(v-1)*v//2

print(answer)
### BUGGY CODE ###

#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline()[:-1]

def main():
    n = int(input())
    la = list(map(int, input().split()))
    lb = list(map(int, input().split()))
    lc = list(map(int, input().split()))
    
    la.sort()
    lb.sort()
    lc.sort()

    ans = 0
    for a in la:
        if a < lb[-1]:
            idxb = bisect.bisect_right(lb, a)
            for b in lb[idxb:]:
                if b < lc[-1]:
                    idxc = bisect.bisect_right(lc, b)
                    ans += (n - idxc)
    print(ans) 

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline()[:-1]

def main():
    n = int(input())
    la = list(map(int, input().split()))
    lb = list(map(int, input().split()))
    lc = list(map(int, input().split()))
    
    la.sort()
    lb.sort()
    lc.sort()

    ans = 0
    for b in lb:
        idxa = bisect.bisect_left(la, b)
        idxc = bisect.bisect_right(lc, b)
        if idxa > 0 and idxc < n:
            ans += idxa * (n - idxc)
    print(ans) 

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

N = int(input())
S = input()
L = []
import itertools
seq = [i for i in range(N)]
combi = list(itertools.combinations(seq,3))
for c in combi:
    x = [S[j] for j in c]
    L.append("".join(x))
print(len(set(L)))

### FIXED CODE ###

def solve():
    ans = 1
    N = int(input())
    s = input()
    ans = 0
    for i in range(1000):
        t = str(i).zfill(3)
        t_index = 0 
        for s_index in range(N):
            if s[s_index] == t[t_index]:
                t_index += 1
                if t_index == 3:
                    break
        if t_index == 3:
            ans += 1
    print(ans)
solve()
### BUGGY CODE ###

N, M = map(int, input().split())
A = []
for i in range(M):
  A.append(int(input()))

X = [0] * (N + 1)
for i in range(N + 1):
  if i == 0:
    X[i] = 1
  elif i == 1:
    if 1 not in A:
      X[i] = 1
    else:
      X[i] = 0
  else:
    if i in A:
      X[i] = 0
    else:
      X[i] = (X[i - 1] + X[i - 2]) % 1000000007

print(X[N])


### FIXED CODE ###

N, M = map(int, input().split())
A = []
for i in range(M):
  A.append(int(input()))

X = [0] * (N + 1)
for i in A:
  X[i] = -1

for i in range(N + 1):
  if i == 0:
    X[i] = 1
  elif i == 1:
    if X[i] == -1:
      X[i] = 0
    else:
      X[i] = 1
  else:
    if X[i] == -1:
      X[i] = 0
    else:
      X[i] = (X[i - 1] + X[i - 2]) % 1000000007

print(X[N])
### BUGGY CODE ###

def checkxor(a,b):
    zero = set([0])
    for x in a:
        temp = set()
        for y in zero:
            temp.add(x^y)
        zero |= temp
    one = set([0])
    for x in b:
        temp = set()
        for y in one:
            c = x ^ y
            if c not in zero:
                return False
            else:
                temp.add(c)
        one |= temp
    return True

T = int(input())
for i in range(T):
    N = int(input())
    A = list(map(int, input().split()))
    S = input()
    if S[-1] == '1':
        print('1')
    elif S.count('0') == len(S):
        print('0')
    else:
        zeros = []
        ones = []
        for j in range(len(S)):
            if S[j] == '1':
                ones.append(A[j])
                current = 1
                break
        for k in range(j+1,len(S)):
            if S[k] == '1':
                if current == 1:
                    ones.append(A[k])
                else:
                    if checkxor(zeros,ones) == False:
                        print('1')
                        break
                    else:
                        ones.append(A[k])
                        current = 1
            else:
                if current == 0:
                    zeros.append(A[k])
                else:
                    zeros.append(A[k])
                    current = 0
        if checkxor(zeros,ones) == False:
            print('1')
        else:
            print('0')

### FIXED CODE ###

T = int(input())
for i in range(T):
    N = int(input())
    A = list(map(int, input().split()))
    S = input()
    base = []
    for i in range(1,N+1):
        temp = A[-i]
        for x in base:
            temp = min(temp,temp^x)
        if temp != 0:
            if S[-i] == '1':
                print('1')
                break
            else:
                base.append(temp)
    else:
        print('0')
### BUGGY CODE ###

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

import numpy as np
import itertools

N, K = map(int, input().split())
A = np.array(list(map(int, input().split())), dtype=np.int)

first_index = np.arange(0, N-K+1)

perm = list(itertools.permutations(first_index))

step_min = len(first_index)

for indexs in perm:
    Ac = A.copy()
    step = 0
    for i in indexs:
        Ac[i:i+K] = Ac[i:i+K].min()
        step += 1
        if np.all(Ac == 1) and step < step_min:
            step_min = step
            break
        if step > step_min:
            break
                
print(step_min)

### FIXED CODE ###

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

import math

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

print(math.ceil((N-1)/(K-1)))
### BUGGY CODE ###

N = int(input())
S = input()
ans = 0
for i in range(1000):
    tmp = str(i).zfill(3)
    count = 0
    for k in S:
        if k == tmp[count]:
            count += 1
        if 3 == count:
            ans += 1
            break
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
ans = 0
for i in range(1000):
    tmp = str(i)
    while len(tmp) < 3:
        tmp = '0' + tmp
    count = 0
    target = S
    for i in tmp:
        target = target.replace(i,'')
    for k in S:
        if 3 <= count:
            break
        if k == tmp[count]:
            count += 1
    if count == 3:
        ans += 1
print(ans)
### BUGGY CODE ###

#from fractions import gcd
#from math import gcd
import numpy as np
import sys
input = sys.stdin.readline
mod = 10**9+7

def my_gcd(a,b):
    while(b):
        a,b=b, a%b
    return a    

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

lcm=1
for s in A:
    lcm=s*lcm//my_gcd(lcm, s)

ans = np.sum([lcm // s %mod for s in A]) % mod

print(int(ans))

### FIXED CODE ###

from fractions import gcd
#from math import gcd
import numpy as np
import sys
input = sys.stdin.readline
mod = 10**9+7

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

lcm = 1
for s in A:
    lcm = s*lcm//gcd(lcm, s)

ans = lcm*sum([pow(s, mod-2, mod) for s in A]) % mod
#ans = sum([lcm//s % mod for s in A]) % mod

print(int(ans%mod))
### BUGGY CODE ###

N = int(input())

def Base10toN(X, n):
    if (int(X / n)):
        return Base10toN(int(X / n), n) + str(X % n)
    else:
        return str(X % n)

def f(amount):
    if amount <= 5:
        return amount
    s = Base10toN(amount, 6)
    fs = f(amount - 6 ** (len(s) - 1))
    n = Base10toN(amount, 9)
    fn = f(amount - 9 ** (len(n) - 1))
    if (fs < fn):
        return fs + 1
    else:
        return fn + 1

print(f(N))

### FIXED CODE ###

N= int(input())
memo = [-1] * 100001

def Base10toN(X, n):
    if (int(X / n)):
        return Base10toN(int(X / n), n) + str(X % n)
    else:
        return str(X % n)

def f(amount):
    if memo[amount] != -1:
        return memo[amount]
    if amount <= 5:
        memo[amount] = amount
        return amount
    s = Base10toN(amount, 6)
    fs = f(amount - 6 ** (len(s) - 1))
    n = Base10toN(amount, 9)
    fn = f(amount - 9 ** (len(n) - 1))
    if (fs < fn):
        memo[amount] = fs + 1
        return fs + 1
    else:
        memo[amount] = fn + 1
        return fn + 1

print(f(N))
### BUGGY CODE ###

import sys

input = lambda: sys.stdin.readline()


def cin_int_list():
    return [int(x) for x in input().split()]


def cin_int_iter():
    return (int(x) for x in input().split())


def cin_int():
    return int(input())


def cout_int_iter(a):
    print(' '.join(map(str, a)))


def iota(n, start=0):
    return list(range(start, n))


def cin_digits_list():
    return [ord(x) - ord('0') for x in input()]


def main():
    n, k = cin_int_iter()

    g = {}

    cycle_starts = None
    for u, x in enumerate(cin_int_list()):
        v = x - 1
        g[u] = v
        if v in g:
            cycle_starts = v

    if cycle_starts:
        cycle_len = 0

        u = cycle_starts
        cycle = []
        while True:
            cycle.append(u)
            u = g[u]

            if u == cycle_starts:
                break

        before_cycle = []
        u = 0

        while u != cycle_starts:
            before_cycle.append(u)
            u = g[u]

        if k < len(before_cycle):
            print(before_cycle[k] + 1)
            return

        if before_cycle:
            k -= len(before_cycle)

        print(cycle[k % len(cycle)] + 1)
        return

    u = 0
    while k:
        u = g[u]
        k -= 1

    print(u + 1)




main()


"""
6 1
6 5 2 5 3 2

6 2
6 5 2 5 3 2

6 3
6 5 2 5 3 2

6 4
6 5 2 5 3 2

6 6
6 5 2 5 3 2

6 5
6 5 2 5 3 2
"""

### FIXED CODE ###

import sys

input = lambda: sys.stdin.readline()


def cin_int_list():
    return [int(x) for x in input().split()]


def cin_int_iter():
    return (int(x) for x in input().split())


def cin_int():
    return int(input())


def cout_int_iter(a):
    print(' '.join(map(str, a)))


def iota(n, start=0):
    return list(range(start, n))


def cin_digits_list():
    return [ord(x) - ord('0') for x in input()]


def main():
    n, k = cin_int_iter()

    g = {}

    for u, x in enumerate(cin_int_list()):
        v = x - 1
        g[u] = v

    visited = set()

    u = 0
    while u not in visited:
        visited.add(u)
        u = g[u]

    cycle_starts = u

    u = cycle_starts
    cycle = []
    while True:
        cycle.append(u)
        u = g[u]

        if u == cycle_starts:
            break

    before_cycle = []
    u = 0

    while u != cycle_starts:
        before_cycle.append(u)
        u = g[u]

    if k < len(before_cycle):
        print(before_cycle[k] + 1)
        return

    if before_cycle:
        k -= len(before_cycle)

    print(cycle[k % len(cycle)] + 1)




main()


"""
6 1
6 5 2 5 3 2

6 2
6 5 2 5 3 2

6 3
6 5 2 5 3 2

6 4
6 5 2 5 3 2

6 6
6 5 2 5 3 2

6 5
6 5 2 5 3 2


no cycle

4 1
2 3 4 5

4 111111111111111111
2 3 4 1

1 111111111111111111
1

2 1999999999999999999
2 1

3 99999999999999999999
2 3 2

3 99999999999999999999
2 3 4
"""
### BUGGY CODE ###

import itertools
N=int(input())
S=input()
S1=[S[i] for i in range(N)]
se=set(list(itertools.combinations(S1,3)))
print(len(se))

### FIXED CODE ###

N=int(input())
S=input()
cnt=0
for i in range(1000):
  con=0
  if i<10:
    a="00"+str(i)
  elif i<100:
    a="0"+str(i)
  else:
    a=str(i)
  for j in range(N):
    if S[j]==a[con]:
      con+=1
      if con==3:
        cnt+=1
        break
print(cnt)
### BUGGY CODE ###

N, Y = map(int,input().split())
t = Y//1000
counter = 0
if counter==0:
    for i in range(t//10+1):
        if counter==0:   
            for j in range(t//5+1):
                if counter==0:
                    for k in range(t+1):
                        if (10000*i+5000*j+1000*k)==Y and (i+j+k)==N and counter == 0:
                            counter+=1
                            print(i, j, k)
                            break
if counter == 0:
    print(-1, -1, -1)

### FIXED CODE ###

N, Y = map(int,input().split())#調べる要素が少ないものからループしないと実行時間が間に合わない。
counter = 0
if counter==0:
    for i in range(Y//10000+1):
        if counter==0:   
            for j in range((Y-10000*i)//5000+1):
                    if (10000*i+5000*j+1000*(N-i-j))==Y and counter == 0 and N-i-j>=0:
                        counter+=1
                        print(i, j, (N-i-j))
                        break
if counter == 0:
    print(-1, -1, -1)
### BUGGY CODE ###

S = input()

C, qi = [1] + [0] * 12, 1

for i in range(len(S)):
    if S[-(i + 1)] == '?':
        tC = [0] * 13
        for j in range(10):
            q = (j * qi) % 13
            for c in range(13):
                tC[(c + q) % 13] += C[c]
        C = tC
    else:
        q, tC = (int(S[-(i + 1)]) * qi) % 13, [0] * 13
        for c in range(13):
            tC[(c + q) % 13] = C[c]
        C = tC
    qi = (qi * 10) % 13

print(C[5] % (10 ** 9 + 7))


### FIXED CODE ###

MOD = 10 ** 9 + 7
qTable = [[(j * i) % 13 for j in range(13)] for i in range(11)]

S = input()

C, tC, qi = [1] + [0] * 12, [0] * 13,  1

for i in range(len(S)):
    if S[-(i + 1)] == '?':
        tC = [0] * 13
        for j in range(10):
            q = qTable[j][qi]
            for c in range(13):
                tC[(c + q) % 13] += C[c]
    else:
        q = qTable[int(S[-(i + 1)])][qi]
        for c in range(13):
            tC[(c + q) % 13] = C[c]

    qi = qTable[10][qi]
    for c in range(13):
        C[c] = tC[c] % MOD

print(C[5] % MOD)
### BUGGY CODE ###


from sys import stdin
import heapq

N = int(input())
As = [int(x) for x in stdin.readline().rstrip().split()]
ans = ""

for i in range(N):
    small = heapq.nsmallest(i + 1, As)
    index = As.index(small[i])
    ans += str(index + 1) + " "

print(ans)


### FIXED CODE ###


from sys import stdin
import heapq

N = int(input())
As = [int(x) for x in stdin.readline().rstrip().split()]
ans = [0] * N

for i in range(N):
    x = As[i]
    ans[x-1] = i + 1

ans = ' '.join(map(str, ans))
print(ans)