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

def main():
    s = input()
    t = input()
    sett = list(set((t)))
    settindex = {}
    for i in sett:
        settindex[i] = sett.index(i)
        if i not in s:
            print(-1)
            return
    lens = len(s)
    lent = len(t)
    lensett = len(sett)
    # index[i文字目以降][settのindex]に何文字目にあるかが格納される
    index = [[] for _ in range(lens)]
    for i in range(lens):
        x = s[i:] + s[:i]
        for j in sett:
            index[i].append(x.index(j))
    ans = 0
    n = 0
    for i in t:
        j = settindex[i]
        ans += index[n % lens][j] + 1
        n += index[n % lens][j] + 1
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    s = input()
    t = input()
    s2 = s * 2
    sett = list(set((t)))
    settindex = {}
    for i in sett:
        settindex[i] = sett.index(i)
        if i not in s:
            print(-1)
            return
    lens = len(s)
    # index[i文字目以降][settのindex]に何文字目にあるかが格納される
    index = [[-1] * len(sett) for _ in range(lens)]
    ans = 0
    n = 0
    for i in t:
        j = settindex[i]
        if index[n][j] == -1:
            index[n][j] = s2[n:].index(i)
        ans += index[n][j] + 1
        n += index[n][j] + 1
        n %= lens
    print(ans)


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


from bisect import bisect_left,bisect
 
n=int(input())
s=input()
#n=39
#s="RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB"

#n=7
#s="RBRBGRB"

r=[]
g=[]
b=[]

for i in range(n):
    if s[i]=="R":
        r.append(i+1)
    elif s[i]=="G":
        g.append(i+1)
    else:
        b.append(i+1)

lenr=len(r)
leng=len(g)
lenb=len(b)

#print(r)
#print(g)
#print(b)

isum=0
for ir in range(len(r)):
    for ig in range(len(g)):
        imin=max(r[ir],g[ig])
        bi=bisect(b,imin)
#        print(ir,ig,imin,bi)
        if abs(r[ir]-g[ig])+imin in b: 
            isum=isum+lenb-bi-1
        else:
            isum=isum+lenb-bi
for ir in range(len(r)):
    for ib in range(len(b)):
        imin=max(r[ir],b[ib])
        gi=bisect(g,imin)
        if abs(r[ir]-b[ib])+imin in g: 
            isum=isum+leng-gi-1
        else:
            isum=isum+leng-gi
for ig in range(len(g)):
    for ib in range(len(b)):
        imin=max(g[ig],b[ib])
        ri=bisect(r,imin)
        if abs(g[ig]-b[ib])+imin in r: 
            isum=isum+lenr-ri-1
        else:
            isum=isum+lenr-ri
                
print(isum)
                

        

### FIXED CODE ###

n=int(input())
s=input()

r=set()
g=set()
b=set()

for i in range(n):
    if s[i]=="R":
        r.add(i+1)
    elif s[i]=="G":
        g.add(i+1)
    else:
        b.add(i+1)

lenr=len(r)
leng=len(g)
lenb=len(b)

isum=0
for ir in r:
    for ig in g:
        if (ir+ig)/2 in b: 
            isum=isum+1
for ir in r:
    for ib in b:
        if (ir+ib)/2  in g: 
            isum=isum+1
for ig in g:
    for ib in b:
        if (ig+ib)/2  in r: 
            isum=isum+1

isum=lenr*leng*lenb-isum
                
print(isum)
### BUGGY CODE ###

H, W, D = map(int, input().split())
A_where = [0] * (H*W+1)
A_where[0] = (-1, -1)
for p in range(H):
    A = list(map(int, input().split()))
    for q in range(W):
        A_where[A[q]] = (p, q)

Q = int(input())

DP = [[0] * (H*W+1) for _ in range(H*W+1)]

for w in range(D, H*W, D):
    for start in range(H*W+1):
        if start + w > H*W:
            continue
        if w == D:
            y1, x1 = A_where[start]
            y2, x2 = A_where[start + w]
            DP[start][start+w] = abs(y1-y2) + abs(x1-x2)
        else:
            DP[start][start+w] = DP[start][start+w-D] + DP[start+w-D][start+w]

for i in range(Q):
    l, r = map(int, input().split())
    print(DP[l][r])



### FIXED CODE ###

H, W, D = map(int, input().split())
A_where = [0] * (H*W+1)
A_where[0] = (-1, -1)
for p in range(H):
    A = list(map(int, input().split()))
    for q in range(W):
        A_where[A[q]] = (p, q)

Q = int(input())

DP = [0] * (H*W+1)

for i in range(D+1, H*W+1):
    y1, x1 = A_where[i]
    y2, x2 = A_where[i-D]

    DP[i] = DP[i-D] + abs(y1-y2) + abs(x1-x2)

for i in range(Q):
    l, r = map(int, input().split())
    print(DP[r] - DP[l])
### BUGGY CODE ###

from collections import defaultdict
n, m = map(int, input().split())
card = defaultdict(int)
for i in range(m):
    l, r = map(int, input().split())
    for j in range(l, r+1):
        card[j] += 1
cnt = 0
for i, v in card.items():
    if v == m:
        cnt += 1
print(cnt)


### FIXED CODE ###

from collections import defaultdict
n, m = map(int, input().split())
left = []
right = []
for i in range(m):
    l, r = map(int, input().split())
    left.append(l)
    right.append(r)

if min(right) >= max(left):
    print(min(right) - max(left) + 1)
else:
    print(0)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
sa=set(a)
a2=[]
for ii in sa:
  ca=a.count(ii)
  a2.append([ii,ca])
  for jj in range(ca):
    a.remove(ii)
#import numpy as np
#a2=np.array(a2)
#print(a2)
q=int(input())
for ii in range(q):
  b,c=map(int,input().split())
  s=0
  idx=[]
  for jj in range(len(a2)):
    if a2[jj][0]==b or a2[jj][0]==c:
      idx.append(jj)
      s+=a2[jj][1]
      a2[jj][0]=0
      a2[jj][1]=0
  a2.append([c,s])
  #print(a2)
  r=0
  for jj in range(len(a2)):
     r+= a2[jj][0]*a2[jj][1]
  print(r)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ma=10**5
a2=[0]*ma
for ii in a:
  a2[ii-1]+=1

def func(a2):
  r=0
  for jj in range(len(a2)):
     r+= a2[jj]*(jj+1)
  return r

r=func(a2)
q=int(input())
for ii in range(q):
  b,c=map(int,input().split())
  r+=(c-b)*a2[b-1]
  a2[c-1]+=a2[b-1]
  a2[b-1]=0
  print(r)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)

n, q = map(int, input().split())

tree = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

ans = [0 for _ in range(n)]
for _ in range(q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(v, p):
    for u in tree[v]:
        if u == p:
            continue
        else:
            ans[u] += ans[v]
            dfs(u, v)

dfs(0, -1)
print(*ans)


### FIXED CODE ###

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

n, q = map(int, input().split())

tree = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

ans = [0 for _ in range(n)]
for _ in range(q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(v, p):
    for u in tree[v]:
        if u == p:
            continue
        else:
            ans[u] += ans[v]
            dfs(u, v)

dfs(0, -1)
print(*ans)
### BUGGY CODE ###

q = int(input())

num = [i for i in range(2,10**5+1)]
so = []
while len(num):
  i = num[0]
  so.append(i)
  num = [j for j in num if j%i!=0]

import bisect

like2017 = []
for sos in so:
  l_idx = bisect.bisect_left(so, (sos+1)//2)
  if l_idx>=len(so) or sos%2==0:continue
  if so[l_idx]==(sos+1)//2:
    like2017.append(sos)
#print(like2017[:20])  

for _ in range(q):
  ans = 0
  l, r = map(int, input().split())
  l_idx = bisect.bisect_left(like2017, l)
  r_idx = bisect.bisect_right(like2017, r)
  #print(l_idx, r_idx)
  ans = r_idx-l_idx
  print(ans)

### FIXED CODE ###

q = int(input())
n = 10**5+1
p = [0]*n
p[2] = 1
for i in range(3,10**5+1):
  prime = 1
  for j in range(2, int(i**0.5)+1):
    if i%j==0:
      prime = 0
      break
  if prime:
    p[i] = 1

like2017 = [1 if p[i] and p[(i+1)//2] else 0 for i in range(n)]
cnter = [0]*n
for i in range(1,n):
  cnter[i] = cnter[i-1]+ like2017[i]

for _ in range(q):
  ans = 0
  l, r = map(int, input().split())
  ans = cnter[r]-cnter[l-1]
  print(ans)
### BUGGY CODE ###

from itertools import product

X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

a = []
for i, j in product(A[0:K+1], B[0:K+1]):
    a.append(i + j)

ans_list = []
for i, j in product(a, C[0:K+1]):
    ans_list.append(i + j)
ans_list.sort(reverse=True)

for i in range(K):
    print(ans_list[i])

### FIXED CODE ###

from itertools import product

X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

a = []
count = 0
for i in range(X):
    for j in range(Y):
        if (i+1)*(j+1) > K:
            break
        for k in range(Z):
            if (i+1)*(j+1)*(k+1) > K:
                break
            a.append(A[i] + B[j] + C[k])

a.sort(reverse=True)

for i in range(K):
    print(a[i])
### BUGGY CODE ###

a, b = map(int, input().split())
min_n = min([a, b])
temp_list = []
for i in range(1, min_n + 1):
  if a % i == 0 and b % i == 0:
    temp_list.append(i)
ans = 0
for i in temp_list:
  if i == 1 or i == 2:
    ans += 1
  else:
    for j in range(2, i):
      if i % j == 0:
        break
      elif j == i - 1:
        ans += 1
print(ans)

### FIXED CODE ###

# -*- Coding: utf-8 -*-
a, b = map(int, input().split())
def my_gcd(a, b):
  if b == 0:
    return a
  else:
    return my_gcd(b, a % b)

gcd = my_gcd(a, b)
sqrt_gcd = int(gcd ** 0.5)
div_list = []
i = 2
res_gcd = gcd

while i <= sqrt_gcd:
  if res_gcd % i == 0:
    div_list.append(i)
    res_gcd = res_gcd / i
  else:
    i += 1
  if res_gcd == 1:
    break
if res_gcd > 1:
  div_list.append(gcd)
uni_cd = list(set(div_list))
ans = 1 + len(uni_cd)
print(ans)
### BUGGY CODE ###

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

for i in range(k):
    keep *= A[i]


for j in range(n - k):
    if A[k + j] > A[j]:
        print("Yes")
    else:
        print("No")
    keep = keep * A[k + j] / A[j]


### FIXED CODE ###

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

for j in range(n - k):
    if A[k + j] > A[j]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

n,k = [int(i) for i in readline().split()]
s = input()
d = {'L':-1,'R':1}
l = [d[i] for i in s]

ans = 0

for _ in range(k):
  left = 0
  flag_left = 0
  right = n-1
  flag_right = 0
  while left < right and not (flag_left and flag_right):
    if l[left] != l[left+1] and not flag_left:
      left += 1
      flag_left = 1
    elif l[left] == l[left+1] and not flag_left:
      left += 1
    if l[right] != l[right-1] and not flag_right:
      right -= 1
      flag_right = 1
    elif l[right] == l[right-1] and not flag_right:
      right -= 1
  if flag_left == 0:
    left = 0
  if flag_right == 0:
    right = n-1
  if flag_left == flag_right == 1 and left > right:
    left = 0
  for i in range(left, right+1):
    l[i] *= -1

for i in range(n-1):
  if l[i] == l[i+1]:
    ans += 1

print(ans)

### FIXED CODE ###

"""
1度の操作で最大+2できる
隣り合う箇所はN-1
LないしRが連続している箇所をグループとして見ると、求める数は
  N-1-隣り合うグループが異なっている場所の個数
= N-1-(グループの個数-1)
"""
import sys
sys.setrecursionlimit(10**6)
n, k = map(int, input().split())
s = input()

score = 0
for i in range(n-1):
    if s[i] == s[i+1]: score += 1

ans = min(score+2*k, n-1)
print(ans)
### BUGGY CODE ###

s = list(input())
print(sum(s[:i].count("B") for i in range(len(s)) if s[i]=="W"))

### FIXED CODE ###

c = b = 0
for s in input():
  c += b*(s=="W")
  b += s=="B"
print(c)
### BUGGY CODE ###

import sys
from math import sqrt
from collections import Counter, defaultdict

input = sys.stdin.readline


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    k = I()

    c = 0
    for i in range(1, 99999999999):
        string = str(i)
        s0 = int(string[0])
        flag = True
        for s in string:
            ints = int(s)
            if abs(ints - s0) > 1:
                flag = False
                break
            s0 = ints
        if flag:
            c += 1
        if c == k:
            print(i)
            break

    pass


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from math import sqrt
from collections import Counter, defaultdict, deque

input = sys.stdin.readline


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    k = I()

    q = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])
    for i in range(1, 10 ** 5 + 1):
        ln = q.popleft()

        if i == k:
            print(ln)
            break

        r = ln % 10
        new_ln = ln * 10 + r
        if r != 0:
            q.append(new_ln - 1)
        q.append(new_ln)
        if r != 9:
            q.append(new_ln + 1)


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

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

Q, K = map(int, input().split())
shortest_path = [0 for _ in range(N+1)]
queue = [t + [K] for t in T[K]]
while len(queue) > 0:
    v = queue.pop(0)
    shortest_path[v[0]] = v[1]
    for u in T[v[0]]:
        if u[0] != v[2]:
            queue.append([u[0], u[1] + v[1], v[0]])

for _ in range(Q):
    x, y = map(int, input().split())
    print(shortest_path[x] + shortest_path[y])

### FIXED CODE ###

from collections import deque

N = int(input())
T = [{} for i in range(N+1)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    T[a][b] = c
    T[b][a] = c

Q, K = map(int, input().split())
shortest_path = [0 for _ in range(N+1)]
queue = deque([[v, T[K][v], K] for v in T[K].keys()])
for _ in range(N-1):
    v = queue.popleft()
    shortest_path[v[0]] = v[1]
    queue.extend([[u, T[v[0]][u] + v[1], v[0]] for u in T[v[0]].keys() if u != v[2]])

for _ in range(Q):
    x, y = map(int, input().split())
    print(shortest_path[x] + shortest_path[y])
### BUGGY CODE ###

x=int(input())
a=0
while True:
    b=a**5-x
    if b<0:
        b=-((-b)**(1/5))
    else:
        b=b**(1/5)
    try:
        c=int(b)
    except:
        a+=1
    else:
        if b==c and a**5-c**5==x:
            print(str(a)+" "+str(c))
            break
        else:
            a+=1

### FIXED CODE ###

x=int(input())
a=0
while True:
    b=a**5-x
    if b<0:
        b=-((-b)**(1/5))
    else:
        b=b**(1/5)
    c=int(b)
    if (a**5-c**5)==x:
        print(str(a)+" "+str(c))
        break
    a+=1
### BUGGY CODE ###

#coding:utf-8

import fractions
from functools import reduce

from copy import deepcopy

# def lcm(x, y):
#     return (x * y) // fractions.gcd(x, y)

big = 1000000007

def lcm(primes, num):
    facto = factorization(num)
    for key in facto:
        if key in primes:
            primes[key] = max(primes[key], facto[key])
        else:
            primes[key] = facto[key]
    return primes
        
def devide_facto(devided, deviding):
    devided = deepcopy(devided)
    for key in deviding:
        devided[key] -= deviding[key]
    return devided

def prod_facto(facto):
    prodv = 1
    for key in facto:
        if facto[key] == 0:
            continue
        prodv = prodv * key ** facto[key]
        prodv %= big
    return prodv
    
    
def factorization(num):
    i = 2
    facto = {}
    while i <= num ** (0.5):
        if num % i == 0:
            if i in facto.keys():
                facto[i] += 1
            else:
                facto[i] = 1
            num //= i
            continue
        i += 1
    if num in facto.keys():
        facto[num] += 1
    else:
        facto[num] = 1
    return facto
    

n = int(input())
a = list(map(int, input().split(' ')))
primes = {}
for num in a:
    primes = lcm(primes, num)

sumv = 0        
for num in a:
    facto_num = factorization(num)
    facto_devided = devide_facto(primes, facto_num)
    
    sumv += prod_facto(facto_devided)
    sumv %= big
    
print(sumv)


### FIXED CODE ###

#coding:utf-8

from fractions import gcd
n = int(input())
a = list(map(int, input().split(' ')))

mod = 10 ** 9 + 7

#最小公倍数を取得
g = a[0]
for num in a[1:]:
    g = g * num // gcd(num, g)

ans = 0
#計算後なのでmodオッケー
l = g % mod
for num in a:
    ans += l * pow(num, mod-2, mod)
    ans %= mod
print(ans % mod)
### BUGGY CODE ###

input=__import__('sys').stdin.readline
def getdist(a,b):return abs(a[0]-b[0])+abs(a[1]-b[1])
n=int(input())
s=[]
for _ in range(n):
    s+=[*map(int,input().split())],
s.sort()
ans=0
sx=sorted(s)
sy=sorted(s,key=lambda x:x[1])
for i in sx:
    ans=max(ans,getdist(sx[0],i))
    ans=max(ans,getdist(sx[-1],i))
ans=max(ans,getdist(sx[-1],sx[-2]))
ans=max(ans,getdist(sx[0],sx[1]))
for i in sy:
    ans=max(ans,getdist(sy[0],i))
    ans=max(ans,getdist(sy[-1],i))
ans=max(ans,getdist(sy[-1],sy[-2]))
ans=max(ans,getdist(sy[0],sy[1]))
def ff1(x):return x[0]+x[1]
def ff2(x):return x[0]-x[1]
f1=sorted(s,key=ff1)
f2=sorted(s,key=ff2)
ans=max(ans,getdist(f1[0],f1[-1]))
ans=max(ans,getdist(f1[0],f1[1]))
ans=max(ans,getdist(f1[-1],f1[-2]))
ans=max(ans,getdist(f2[0],f2[-1]))
ans=max(ans,getdist(f2[0],f2[1]))
ans=max(ans,getdist(f2[-1],f2[-2]))
def ff1(x):return abs(x[0]+x[1])
def ff2(x):return abs(x[0]-x[1])
f1=sorted(s,key=ff1)
f2=sorted(s,key=ff2)
ans=max(ans,getdist(f1[0],f1[-1]))
ans=max(ans,getdist(f1[0],f1[1]))
ans=max(ans,getdist(f1[-1],f1[-2]))
ans=max(ans,getdist(f2[0],f2[-1]))
ans=max(ans,getdist(f2[0],f2[1]))
ans=max(ans,getdist(f2[-1],f2[-2]))
print(ans)

### FIXED CODE ###

input=__import__('sys').stdin.readline
def getdist(a,b):return abs(a[0]-b[0])+abs(a[1]-b[1])
n=int(input())
s=[]
for _ in range(n):s.append([*map(int,input().split())])
ans=0
sx=sorted(s)
sy=sorted(s,key=lambda x:x[1])
ans=max(ans,getdist(sx[-1],sx[-2]))
ans=max(ans,getdist(sx[0],sx[1]))
ans=max(ans,getdist(sy[-1],sy[-2]))
ans=max(ans,getdist(sy[0],sy[1]))
def ff1(x):return x[0]+x[1]
def ff2(x):return x[0]-x[1]
f1=sorted(s,key=ff1)
f2=sorted(s,key=ff2)
ans=max(ans,getdist(f1[0],f1[-1]))
ans=max(ans,getdist(f1[0],f1[1]))
ans=max(ans,getdist(f1[-1],f1[-2]))
ans=max(ans,getdist(f2[0],f2[-1]))
ans=max(ans,getdist(f2[0],f2[1]))
ans=max(ans,getdist(f2[-1],f2[-2]))
def ff1(x):return abs(x[0]+x[1])
def ff2(x):return abs(x[0]-x[1])
f1=sorted(s,key=ff1)
f2=sorted(s,key=ff2)
ans=max(ans,getdist(f1[0],f1[-1]))
ans=max(ans,getdist(f1[0],f1[1]))
ans=max(ans,getdist(f1[-1],f1[-2]))
ans=max(ans,getdist(f2[0],f2[-1]))
ans=max(ans,getdist(f2[0],f2[1]))
ans=max(ans,getdist(f2[-1],f2[-2]))
print(ans)
### BUGGY CODE ###

import heapq
def SME(start,end):
    A = []
    if end > N : end = N
    count = 0
    for i,x in enumerate(Whole[start:end]):
        heapq.heappush(A,[x,i])
    for j in range(start,end):
        a = heapq.heappop(A)
        for i in range(L):
            idx = a[1] + i
            try :
                if ANS[idx] : continue
                else :
                    ANS[idx] = a[0]
                    count += 1
            except IndexError : continue
        if count > N * 0.85 : break
    for i in range(L):
        if ANS[i] : continue
        else : ANS[i] = min(Whole[:i+1])
    for i in range(L,N):
        if ANS[i] : continue
        else : ANS[i] = min(Whole[i+1-L:i+1])
    return ANS

[N,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
ANS = [None]*N
ANS = SME(0, N)
for i in ANS[L-1:-1]:print(i, end=" ")
print(ANS[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

n = int(input())
a = [int(i) for i in input().split()]

for i in range(n):
	for j in range(n):
		if i < j:
			if a[i] == a[j]:
				print("NO")
				exit()

print("YES")

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]

if len(a) == len(set(a)):
	print("YES")
else:
	print("NO")
### BUGGY CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np

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

dp = np.ones(N)*float("inf")
dp[0] = 0
dp[1] = abs(H[1] - H[0])

for i in range(2, N):
    start = max(0, i-K)
    dp[i] = np.min(dp[start:i] + abs(H[start:i] - H[i]))

print(int(dp[N-1]))


### FIXED CODE ###

n,k = map(int,input().split())
ls = list(map(int,input().split()))
dp = [10000000000] *n
dp[0] = 0
dp[1] = abs(ls[1]-ls[0])
p = 10000000000
for i in range(2,n):
    for j in range(i-k,i):
        if (dp[j] >= p) or (abs(ls[j] - ls[i]) >= p):
            pass
        else:
            a = dp[j] + abs(ls[j] - ls[i])
            if a < p:
                p = a
                a = 0
            else:
                a = 0
    dp[i] = p
    p = 10000000000
print(dp[n-1])
### BUGGY CODE ###

import sys
import fractions


def in_ctrl():
    _input = [_.rstrip() for _ in sys.stdin.readlines()]
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    K = int(_input[0])
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return K


def out_ctrl(s):
    print(s)


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


if __name__ == "__main__":
    K = in_ctrl()
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 0
    # 全部同じ数字(a=b=c)
    for a in range(1,K+1):
        cnt += a
    # 1つ同じ数字(a<b=c)
    for a in range(1,K+1):
        for b in range(a+1,K+1):
            ans = fractions.gcd(a,b)
            cnt += 6*ans
    # 全部違う数字(a<b<c)
    for a in range(1,K+1):
        for b in range(a+1,K+1):
            for c in range(b+1,K+1):
                if a !=b and b!=c:
                    ans = fractions.gcd(a,b)
                    cnt += 6*fractions.gcd(ans, c)
                else:
                    pass
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    out_ctrl(cnt)

### FIXED CODE ###

import sys
import fractions

def in_ctrl():
    _input = [_.rstrip() for _ in sys.stdin.readlines()]
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    K = int(_input[0])
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return K


def out_ctrl(s):
    print(s)


if __name__ == "__main__":
    K = in_ctrl()
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 0
    dict_ = {}
    for a in range(1,K+1):
        cnt += a
        for b in range(a+1,K+1):
            if '{}_{}'.format(a,b) in dict_:
                ans = dict_['{}_{}'.format(a,b)]
            else:
                ans = fractions.gcd(a,b)
                dict_['{}_{}'.format(a,b)] = ans
            cnt += 6*ans
            for c in range(b+1,K+1):
                if '{}_{}'.format(ans,c) in dict_:
                    _ans = dict_['{}_{}'.format(ans,c)]
                else:
                    _ans = fractions.gcd(ans, c)
                    dict_['{}_{}'.format(ans,c)] = _ans
                cnt += 6*_ans
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    out_ctrl(cnt)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list()
for i in range(N):
    for j in range(N):
        if A[j] == i + 1:
            B.append(j + 1)
for k in range(N):
    print(str(B[k]) + ' ', end = '')


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = [0] * N

for i in range(0, N):
    B[A[i] - 1] = i + 1
for i in range(0, N):
    print(str(B[i]) + ' ', end = '')