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

from sys import stdin
n=int(stdin.readline().rstrip())
#print(n)
dic={}
for i in range(n):
    s=stdin.readline().rstrip()
    if s in dic.keys():
        dic[s] +=1
    else:
        dic[s]=1
#print(dic)
#print(dic.keys())
sup=0
suc=[]
for (i,number) in dic.items():
    if number>sup:
        suc=[]
        sup=number
        suc.append(i)
    elif number==sup:
        suc.append(i)
for k in (sorted(suc)):
    print(k)

### FIXED CODE ###

from sys import stdin
n=int(stdin.readline().rstrip())
#print(n)
dic={}
for i in range(n):
    s=stdin.readline().rstrip()
    if s in dic.keys():
        dic[s] +=1
    else:
        dic[s]=1
#print(dic)
#print(dic.keys())
sup=0
suc=[]
for (i,number) in dic.items():
    if number>sup:
        suc=[]
        sup=number
        suc.append(i)
    elif number==sup:
        suc.append(i)
for k in (sorted(suc)):
    print(k)
### BUGGY CODE ###

h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
dp = [10**5 for _ in range(h+1)]
dp[0] = 0
for i in range(1,h+1):
    dp[i] = min([dp[max(0, i-pw)]+ma for pw, ma in ab])
print(dp[h])

### FIXED CODE ###

h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
dp = [10**5 for _ in range(h+1)]
dp[0] = 0
for i in range(1,h+1):
    dp[i] = min([dp[max(0, i-pw)]+ma for pw, ma in ab])
print(dp[h])
### BUGGY CODE ###

def bfs(sx, sy):
    for dx, dy in nb:
        nx = sx + dx
        ny = sy + dy
        if 0 <= nx and nx < h and 0 <= ny and ny < w:
            if grid[nx][ny] == "#":
                darker[sx][sy] = True
                break


h, w = map(int, input().split())
grid = [list(input()) for _ in range(h)]
nb = [(-1, 0), (0, -1), (1, 0), (0, 1)]
ans = 0

while True:
    darker = [[False] * w for _ in range(h)]
    flag = False
    for i in range(h):
        for j in range(w):
            if grid[i][j] == ".":
                bfs(i, j)
    for i in range(h):
        for j in range(w):
            if darker[i][j]:
                grid[i][j] = "#"
            flag = flag or darker[i][j]
    if not (flag):
        break
    ans += 1
print(ans)

### FIXED CODE ###

from collections import deque
 
H, W = map(int, input().split())
A = [input() for i in range(H)]
q = deque()
c = [[-1] * W for i in range(H)]
for i in range(H):
    for j in range(W):
        if A[i][j] == '#':
            q.append((i, j))
            c[i][j] = 0
D = [[0, 1], [1, 0], [0, -1], [-1, 0]]
while q:
    y, x = q.popleft()
    for dy, dx in D:
        ny, nx = y+dy, x+dx
        if 0 <= ny < H and 0 <= nx < W and c[ny][nx] == -1:
            q.append((ny, nx))
            c[ny][nx] = c[y][x]+1
print(max([max(l) for l in c]))
### BUGGY CODE ###

"""
https://qiita.com/drken/items/03c7db44ccd27820ea0d


"""
def main():
        
    S = input()
    T = input()

    """
    dp[i+1]][j+1]
    Sのi番目とtのｊ番目まで見たときの共通する部分列の最大長さ
    """
    dp = [[0 for _ in range(len(T)+1)] for _ in range(len(S)+1)]

    next = {}
    prev = {}
    # 部分列の最大長さを求める
    for i, s in enumerate(S):
        for j, t in enumerate(T):
            if s == t:
                #i番目とｊ番目が同じなら、dp[i+1][j+1]はそれまでの最大長さ＋１
                dp[i+1][j+1] = dp[i][j] + 1
                prev[(i+1, j+1)] = (i,j)
            else:
                #異なる場合はdp[i][j]かd[i+1][j]かdp[i][j+1]のどれかだけども、後者ふたつがi,jより小さいことはないから後ろ二つの大きいほうを採用
                if dp[i+1][j] >= dp[i][j+1]:
                    dp[i+1][j+1] = dp[i+1][j]
                    prev[(i+1, j+1)] = (i+1,j)
                else:
                    dp[i+1][j+1] = dp[i][j+1]
                    prev[(i+1, j+1)] = (i,j+1)

    i, j = len(S), len(T)

    substr = ""
    while i != 0 and j != 0:
        if S[i-1] == T[j-1]:
            substr +=S[i-1] 
        i,j = prev[(i,j)]

    print(substr[::-1])

if __name__ == "__main__":
    main()

### FIXED CODE ###

"""
https://qiita.com/drken/items/03c7db44ccd27820ea0d


"""
def main():
        
    S = input()
    T = input()

    """
    dp[i+1]][j+1]
    Sのi番目とtのｊ番目まで見たときの共通する部分列の最大長さ
    """
    dp = [[0 for _ in range(len(T)+1)] for _ in range(len(S)+1)]

    #prev = {}
    # 部分列の最大長さを求める
    for i, s in enumerate(S):
        for j, t in enumerate(T):
            if s == t:
                #i番目とｊ番目が同じなら、dp[i+1][j+1]はそれまでの最大長さ＋１
                dp[i+1][j+1] = dp[i][j] + 1
                #prev[(i+1, j+1)] = (i,j)
            else:
                #異なる場合はdp[i][j]かd[i+1][j]かdp[i][j+1]のどれかだけども、後者ふたつがi,jより小さいことはないから後ろ二つの大きいほうを採用
                dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])
                #prev[(i+1, j+1)] = (i+1,j) if dp[i+1][j] >= dp[i][j+1] else (i,j+1)

    i, j = len(S), len(T)
    """
    なんかi+1,j+1がどのDPノードから更新されてできたのかをたどって、S[i],T[j]が同じであればそれを部分列に加えられるから～みたいな感じで部分列の後ろから作って最後にひっくり返すといいらしい
    
    """

    substr = ""
    while i != 0 and j != 0:
        # 同じ文字で＋１になっていた場合、その文字を部分列に加える
        if S[i-1] == T[j-1]:
            substr += S[i-1]
            i,j = i-1, j-1
        else:
            i,j = (i, j-1) if dp[i][j-1] >= dp[i-1][j] else (i-1, j)


    #TLEなのでやめた
    """
    while i != 0 and j != 0:
        if S[i-1] == T[j-1]:
            substr +=S[i-1] 
        i,j = prev[(i,j)]
    """
    print(substr[::-1])

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

# from fractions import gcd
# mod = 10 ** 9 + 7
# N = int(input())
# a = list(map(int,input().split()))
# a,b,c = map(int,input().split())
# ans = [0] * N
# math.ceilで切り上げ
# dp = [[0] * 4 for i in range(3)] #2次元配列初期化
# dp = [[[0] * 2 for i in range(3)] for j in range(5)]
# (ord('A'))でASCII出力 Aは65
import math
import statistics
import string


def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  # xからyまでの階乗をzで割ったあまりを求める
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):#最大公約数 math.gcdが使えない時の手段として入れとく。pythonが更新されたらいらなくなるはず
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

s = input()
Q = intinput()

for i in range(Q):
    a = input()
    if a[0] == "1":
        s = s[::-1]
    else:
        b = a.split()
        if b[1] == "1":
            s = b[2] + s
        else:
            s = s + b[2]

print(s)



### FIXED CODE ###

# from fractions import gcd
# mod = 10 ** 9 + 7
# N = int(input())
# a = list(map(int,input().split()))
# a,b,c = map(int,input().split())
# ans = [0] * N
# math.ceilで切り上げ
# dp = [[0] * 4 for i in range(3)] #2次元配列初期化
# dp = [[[0] * 2 for i in range(3)] for j in range(5)]
# (ord('A'))でASCII出力 Aは65
import math
import statistics
import string
import sys
from array import array
from collections import deque

def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  # xからyまでの階乗をzで割ったあまりを求める
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):#最大公約数 math.gcdが使えない時の手段として入れとく。pythonが更新されたらいらなくなるはず
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

s = deque()
s.append(input())
Q = int(input())
rev_count = 0

for i in range(Q):
    a = input()
    if a[0] == "1":
        rev_count += 1
    else:
        b = a.split()
        if rev_count % 2 == 0:
            if b[1] == "1":
                s.appendleft(b[2])
            else:
                s.append(b[2])
        else:
            if b[1] == "1":
                s.append(b[2])
            else:
                s.appendleft(b[2])

if rev_count % 2 == 0:
    print(''.join(s))
else:
    a = ''.join(s)
    print(a[::-1])
### BUGGY CODE ###

n=int(input())
arr=list(map(int,input().split()))
pc=0
mc=0
zc=0
p=[]
m=[]
for i in range(n):
  arr[i]-=(i+1)
  if arr[i]>0:
    pc+=1
    p.append(arr[i])
  elif arr[i]<0:
    mc+=1
    m.append(arr[i])
  else:
    zc+=1
p=sorted(p)
m=sorted(m,reverse=True)
diff=0
while 1:
  if pc+zc>=mc and mc+zc>=pc:
    print(sum(p)+abs(sum(m))+diff)
    break
  else:
    if pc+zc<mc:
      diff+=abs(m[0])*(pc+zc)
      tm=[]
      tmp=abs(m[0])
      pc+=zc
      zc=0
      for i in range(mc):
        m[i]=m[i]+tmp
        if m[i]!=0:
          tm.append(m[i])
        else:
          mc-=1
          zc+=1
      m=tm
    else:
      diff+=p[0]*(mc+zc)
      tp=[]
      tmp=p[0]
      mc+=zc
      zc=0
      for i in range(pc):
        p[i]=p[i]-tmp
        if p[i]!=0:
          tp.append(p[i])
        else:
          pc-=1
          zc+=1

### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
for i in range(n):
  arr[i]=arr[i]-(i+1)
arr=sorted(arr)
if n%2==1:
  m=arr[n//2]
  ans=0
  for i in range(n):
    ans=ans+abs(arr[i]-m)
  print(ans)
else:
  m1=arr[n//2]
  m2=arr[n//2-1]
  ans1=0
  ans2=0
  for i in range(n):
    ans1=ans1+abs(arr[i]-m1)
    ans2=ans2+abs(arr[i]-m2)
  print(min(ans1,ans2))
### BUGGY CODE ###

S = input()
N = len(S)

map_ = [-1] * 2019
map_[0] = 0
ans = 0
now = 0
for i in range(0, N + 1):
    now += (int(S[N - i - 1]) * (10**i)) % 2019
    map_[now % 2019] += 1
    ans += map_[now % 2019]

print(ans)


### FIXED CODE ###

S = input()
N = len(S)

map_ = [-1] * 2019
map_[0] = 0
ans = 0
now = 0
for i in range(0, N):
    now = (now + int(S[N - i - 1]) * pow(10, i, 2019)) % 2019
    map_[now] += 1
    ans += map_[now]

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

import sys
input = sys.stdin.readline
import numpy as np

n,k = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)


left = -1
right = A[-1] * F[0]
while left+1 < right:
    mid = (left+right)//2
    cost = sum(A-np.minimum(A,mid//F))
    if cost <= k:
        right = mid
    else:
        left = mid
print(right)

### FIXED CODE ###

n,k = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)

def isOk(x):
    cost = 0
    for a, f in zip(A,F):
        eatable = x//f
        if eatable >= a:
            continue
        cost += a - eatable
    if cost <= k:
        return True
    return False

left = -1
right = A[-1] * F[0]
while left+1 < right:
    # mid = int(left + (right-left)//2)
    mid = (left+right)//2
    if isOk(mid):
        right = mid
    else:
        left = mid
print(right)
### BUGGY CODE ###

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

A_num = list(set(A))
bar_list = []

for a in A_num:
    if A.count(a) > 1:
        bar_list.append(a)
        if A.count(a) > 3:
            bar_list.append(a)

bar_list.sort()
if len(bar_list) < 2:
    print(0)
else: 
    ans = bar_list[-1] * bar_list[-2]
    print(ans)


### FIXED CODE ###

import collections

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

A_count = collections.Counter(A)
A_most = A_count.most_common()

ans = []
for a in A_most:
    if a[1] > 1:
        ans.append(a[0])
        if a[1] > 3:
            ans.append(a[0])

ans.sort()

print(ans[-1] * ans[-2] if len(ans) > 0 else 0)
### BUGGY CODE ###

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

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

    inf = float("inf")
    dp = [inf]*N

    dp[0] = 0
    steps = [inf] * K

    for i in range(1, N):
        steps = [inf] * K
        for j in range(1, min(i, K) + 1):
            steps[j-1] = abs(H[i-j]-H[i]) + dp[i-j]
        step = min(steps)

        dp[i] = min(dp[i], step)
    print(dp[-1])


if __name__ == "__main__":
    main()


### FIXED CODE ###

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

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

    inf = float("inf")
    dp = [inf]*N

    dp[0] = 0
    steps = [inf] * K

    for i in range(1, N):
        steps = [inf] * K
        for j in range(1, min(i, K) + 1):
            steps[j-1] = abs(H[i-j]-H[i]) + dp[i-j]
        step = min(steps)

        dp[i] = min(dp[i], step)
    print(dp[-1])


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

N = int(input())
S = []
count = 0
for _ in range(N):
    s = list(input())
    s.sort()
    S.append(''.join(s))

for i in range(N):
    for j in range(i+1,N):
        if S[i] == S[j]:
            count += 1

print(count)

### FIXED CODE ###

import math
N = int(input())
S = []
ans = 0
count = 1
for _ in range(N):
    s = list(input())
    s.sort()
    S.append(''.join(s))
S.sort()
S.append('a')

for i in range(N):
    if S[i] == S[i+1]:
        count += 1
    else:
        if count > 2:
            ans += math.factorial(count)//(math.factorial(count-2)*math.factorial(2))
        elif count == 2:
            ans += 1
        count =1

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

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

#n,k,*a = map(int,read().split())
n, = map(int,readline().split())
vw = [(0,0)]+[tuple(map(int,readline().split())) for _ in range(n)]

#print(vw)
A = 9
N = min(1<<A,n+1)

memo = [None for _ in range(N)]
L = 10**5+1
memo[0] = [0]*L

for i in range(1,N):
    m = memo[i>>1][:]
    v,w = vw[i]    
    for j in range(L-1,w-1,-1):
        if m[j] < m[j-w]+v:
            m[j] = m[j-w]+v
    memo[i] = m
    #for j in range(1,L):
    #    memo[i][j] = max(memo[i][j],memo[i][j-1])


def dfs(v,w,u):
    if u < N:
        return memo[u][l-w]+v if l>w else 0
    else:
        return max(dfs(v,w,u>>1),
                   dfs(v+vw[u][0],w+vw[u][1],u>>1))
        

q, = map(int,readline().split())
for _ in range(q):
    u,l = map(int,readline().split())
    
    ans = dfs(0,0,u)
    print(ans)

        


### FIXED CODE ###

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

#n,k,*a = map(int,read().split())

n, = map(int,readline().split())
vw = [[0,0]]+[list(map(int,readline().split())) for _ in range(n)]

def merge(av,aw,bv,bw):
    la,lb = len(aw),len(bw)
    rv = [0]*(la+lb)
    rw = [0]*(la+lb)
    ia = ib = 0
    for i in range(la+lb):
        if ib==lb or (ia < la and aw[ia] < bw[ib]):
            rv[i] = av[ia]
            rw[i] = aw[ia]
            ia += 1
        else:
            rv[i] = bv[ib]
            rw[i] = bw[ib]
            ib += 1
    return rv,rw

A = 10
N = min(1<<A,n+1)
memov = [[] for _ in range(N)]
memow = [[] for _ in range(N)]

memov[0] = [0]
memow[0] = [0]

#from itertools import acumulate
for i in range(1,N):
    v,w = vw[i]
    m2v = [v+v1 for v1 in memov[i>>1]]
    m2w = [w+w1 for w1 in memow[i>>1]]
    memov[i],memow[i] = merge(memov[i>>1],memow[i>>1],m2v,m2w)

    #memov[i] = list(accumulate(memov[i],max))
    for j in range(1,len(memov[i])):
        memov[i][j] = max(memov[i][j-1],memov[i][j])
    
def solve(lstv,lstw,dv,dw,l):
    ans = 0
    idx = len(lstw)-1
    #print(lstv,lstw,dv,dw,l)
    for v,w in zip(dv,dw):
        while idx >= 0 and lstw[idx] + w > l:
            idx -= 1
        if idx >= 0 and v+lstv[idx] > ans:
            ans = v+lstv[idx]
    print(ans)        
 
 

q, = map(int,readline().split())
for _ in range(q):
    u,l = map(int,readline().split())

    dv = [0]
    dw = [0]
    while u >= N:
        v,w = vw[u]
        m2v = [v+v1 for v1 in dv]
        m2w = [w+w1 for w1 in dw]
        dv,dw = merge(dv,dw,m2v,m2w)
        u >>= 1
    
    #for j in range(1,len(dv)):
    #    dv[j] = max(dv[j-1],dv[j])
    
    solve(memov[u],memow[u],dv,dw,l)

#print(memov)
#print(memow)
### BUGGY CODE ###

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

A.sort()
F.sort(reverse = True)
Amax = A[-1]
Fmax = F[0]
As = sum(a for a in A)

x=0
if As > K:
    x1 = 0
    x2 = Amax*Fmax
    while True:
        Asum1 = Asum2 = 0
        for i in range(0,N):
            if x1//F[i] > A[i]:
                if x1<x2:
                    x1 += 1
                    break
            else:
                Asum1 += x1//F[i]
                Asum2 += x2//F[i]
        else:
            if As-Asum1 > K and As-Asum2 <= K:  #x1-NG and x2-OK
                if x1+1==x2:    #0,1,...,x1,x2,...  Xmin=x2
                    x = x2
                    break
                else:       #0,1,...x1,x1+1,...,x2-1,x2,... 
                    x2b = x2
                    x2 = int((x1+x2)//2)
                    continue
            elif As-Asum1 > K and As-Asum2 > K:   #x1-NG and x2-NG
                x1 = x2
                x2 = int((x2+x2b)//2)
                if x1 == x2:
                    x2 += 1
                    continue
print(x)            


### FIXED CODE ###

import numpy as np

N,K = map(int,input().split())
A = np.sort(list(map(int,input().split())))
F = np.sort(list(map(int,input().split())))[::-1]

Amax = A[-1]
Fmax = F[0]

x=0
if sum(A) < K:
    x = 0
else:
    xl = 0
    xh = Amax*Fmax
    while xh-xl > 0:
        xm = int((xl+xh)//2)
        AF = A-xm//F 
        if np.sum(AF[AF>0]) > K: 
            xl = xm + 1
        else: 
            xh = xm
    else:
        x = xl
print(x)
### BUGGY CODE ###

mod=10**9+7

n=int(input())

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

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

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

lcma=1

for i in range(n):
    lcma=lcm(lcma,a[i])

ans=0

for i in range(n):
    ans=(ans+lcma//a[i])%mod

print(ans)



### FIXED CODE ###

mod=10**9+7

n=int(input())

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

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

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

lcma=1

for i in range(n):
    lcma=lcm(lcma,a[i])

ans=0

for i in range(n):
    ans=(ans+lcma//a[i])

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

n,k=map(int,input().split())
p=list(map(int,input().split()))
a=0

for i in range(n-k+1):
    a = max(a,sum([(k+1)/2 for k in p[i:i+k]]))

print(a)

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
a=0
for i in range(n-k+1):
    if i==0:
        xe=sum(p[0:k])
    else:
        xe=xe-p[i-1]+p[i+k-1]
    a=max(a,xe)
print((k+a)/2)
### BUGGY CODE ###

def main():
    n = int(input())
    h = input().split()
    h = [int(n) for n in h]
    max = 0
    now = 0
    i = 0
    while i < n - 1:
        now = 0
        for j in range(i + 1, n):
            if h[j] <= h[j - 1]:
                now += 1
            else:
                i = j - 1
                break
        if now >= max:
            max = now
        i += 1
    print(max)

if __name__ == "__main__":
    main()



### FIXED CODE ###

def main():
    n = int(input())
    h = input().split()
    h = [int(n) for n in h]
    max = 0
    now = 0
    i = 0
    for i in range(n-1):
        if h[i] >= h[i+1]:
            now += 1
        else:
            if now >= max:
                max = now
            now=0
        if now >= max:
            max = now
    print(max)

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

N = int(input())
L = list(map(int,input().split()))
cnt = 0
for a in range(N):
    for b in range(a+1,N):
        for c in range(b+1,N):
                if  L[a] < (L[b]+L[c]) and L[b] < (L[c]+L[a]) and L[c] < (L[a]+L[b]):
                    cnt += 1
print(cnt)

### FIXED CODE ###

import bisect
n=int(input())
l = list(map(int,input().split()))
l.sort()
うんち = 0
for i in range(1,n):
    for j in range(i):
        p = l[i] + l[j]
        q = bisect.bisect_left(l,p)
        うんち += q-i-1
print(うんち)
### BUGGY CODE ###

n, p=map(int, input().split())
b=int(p**(1/n)+1)
for i in reversed(range(1,b+1)):
  if(p%i==0):
    if(p%(i**n)==0):
          c=i
          break
print(c)

### FIXED CODE ###

n, p=map(int, input().split())
b=int(p**(1/n))+1
c=1
for i in reversed(range(1,b+1)):
  if(40<n):
    break
  if(p%i==0):
    if(p%(i**n)==0):
          c=i
          break
print(c)
### BUGGY CODE ###

from collections import deque
def main():
    INF = 10**6

    H,W = map(int,input().split())
    C1,C2 =map(lambda x : int(x) - 1,input().split())
    D1,D2 = map(lambda x : int(x) - 1,input().split())

    S = [input() for _ in range (H)]
    t = [[INF]*W for _ in range (H)]


    for h in range (H):
        Sh = S[h]
        th = t[h]
        for w in range (W):
            if Sh[w] == '#':
                th[w] = -1


    q = deque([(C1,C2)])
    a = 0
    t[C1][C2] = a

    while q:
        warpq = []
        while q:
            h,w = q.popleft()
            warpq.append((h,w))
            if 0 < h and t[h-1][w] > a:
                t[h-1][w] = a
                q.append((h-1,w))
            if H-1 > h and t[h+1][w] > a:
                t[h+1][w] = a
                q.append((h+1,w))
            if 0 < w and t[h][w-1] > a:
                t[h][w-1] = a
                q.append((h,w-1))
            if w < W-1 and t[h][w+1] > a:
                t[h][w+1] = a
                q.append((h,w+1))

        if t[D1][D2]!= INF:
            break

        a+=1

        for h,w in warpq:
            for i in range (max(0,h-2),min(H,h+3)):
                ti = t[i]
                for j in range (max(0,w-2),min(W,w+3)):
                    if ti[j] >a:
                        ti[j] = a
                        q.append((i,j))


    if t[D1][D2] == INF:
        print(-1)
    else:
        print(t[D1][D2])


main()


### FIXED CODE ###

from collections import deque


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

    from builtins import max, min, range

    INF = 10 ** 6

    H, W = map(int, readline().split())
    Ch, Cw = map(lambda x: int(x) - 1, readline().split())
    Dh, Dw = map(lambda x: int(x) - 1, readline().split())
    S = [readline()[:-1] for _ in range(H)]

    t = [[INF] * W for _ in range(H)]
    for h in range(H):
        th = t[h]
        Sh = S[h]
        for w in range(W):
            if Sh[w] == '#':
                th[w] = -1

    t[Ch][Cw] = 0
    q = deque([(Ch, Cw)])
    a = 0
    while q:
        warpq = []
        while q:
            h, w = q.popleft()
            warpq.append((h, w))
            if h - 1 >= 0 and t[h - 1][w] > a:
                q.append((h - 1, w))
                t[h - 1][w] = a
            if h + 1 < H and t[h + 1][w] > a:
                q.append((h + 1, w))
                t[h + 1][w] = a
            if w - 1 >= 0 and t[h][w - 1] > a:
                q.append((h, w - 1))
                t[h][w - 1] = a
            if w + 1 < W and t[h][w + 1] > a:
                q.append((h, w + 1))
                t[h][w + 1] = a

        if t[Dh][Dw] != INF:
            break

        a += 1
        for h, w in warpq:
            for i in range(max(0, h - 2), min(H, h + 3)):
                ti = t[i]
                for j in range(max(0, w - 2), min(W, w + 3)):
                    if ti[j] > a:
                        ti[j] = a
                        q.append((i, j))

    if t[Dh][Dw] == INF:
        print(-1)
    else:
        print(t[Dh][Dw])


main()
### BUGGY CODE ###

N = int(input())
A = [int(i) for i in input().split()]
list_st = []
for i in range(N):
  list_st.append(A.index(i+1)+1)
for i in range(N):
  print(list_st[i])

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])