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

n = int(input())
p = [list(map(int,input().split())) for _ in range(n)]

X = sorted([(i, xy[0]) for i, xy in enumerate(p)], key=lambda x: x[1])
Y = sorted([(i, xy[1]) for i, xy in enumerate(p)], key=lambda x: x[1])
dX = [[X[i][0], X[i+1][0], X[i+1][1]-X[i][1]] for i in range(n-1)]
dY = [[Y[i][0], Y[i+1][0], Y[i+1][1]-Y[i][1]] for i in range(n-1)]
D = sorted(dX+dY, key=lambda x: x[2])

def root(x):
    if parent[x] == x:
        return x
    else:
        return root(parent[x])

def connected(x, y):
    return root(x) == root(y)

parent = [i for i in range(n+1)]
depth = [1 for i in range(n+1)]

ans = 0

while D:
    a, b, d = D.pop(0)
    ra, rb = map(root, [a,b])
    if ra != rb:
        if depth[ra] < depth[rb]:
            a, b = b, a
            ra, rb = rb, ra
        parent[rb] = ra
        depth[ra] = max(depth[ra], depth[rb]+1)
        ans += d
print(ans)


### FIXED CODE ###

n = int(input())
p = [list(map(int,input().split())) for _ in range(n)]

X = sorted([(i, xy[0]) for i, xy in enumerate(p)], key=lambda x: x[1])
Y = sorted([(i, xy[1]) for i, xy in enumerate(p)], key=lambda x: x[1])
dX = sorted([[X[i][0], X[i+1][0], X[i+1][1]-X[i][1]] for i in range(n-1)], key=lambda x: x[2])
dY = sorted([[Y[i][0], Y[i+1][0], Y[i+1][1]-Y[i][1]] for i in range(n-1)], key=lambda x: x[2])

def root(x):
    if parent[x] == x:
        return x
    else:
        return root(parent[x])

def connected(x, y):
    return root(x) == root(y)

parent = [i for i in range(n+1)]
depth = [1 for i in range(n+1)]

ans = 0
i, j = 0, 0
while i < n-1 and j < n-1:
    if dX[i][2] < dY[j][2]:
        a, b, d = dX[i]
        i += 1
    else:
        a, b, d = dY[j]
        j += 1
    ra, rb = map(root, [a,b])
    if ra != rb:
        if depth[ra] < depth[rb]:
            a, b = b, a
            ra, rb = rb, ra
        parent[rb] = ra
        depth[ra] = max(depth[ra], depth[rb]+1)
        ans += d
print(ans)
### BUGGY CODE ###

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

def right(i, j):
    ui = i-1
    di = i+1
    lj = j-1
    rj = j+1
    cnt = 1

    while ui >= 0 and s[ui][j] != '#':
        ui -= 1 
        cnt += 1

    while di < h and s[di][j] != '#':
        di += 1 
        cnt += 1

    while lj >= 0 and s[i][lj] != '#':
        lj -= 1 
        cnt += 1

    while rj < w and s[i][rj] != '#':
        rj += 1 
        cnt += 1
    #print(i, j, ui, di, lj, rj, cnt)
    return cnt

ans = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            continue
        else:
            ans = max(ans, right(i, j))

print(ans)

### FIXED CODE ###

import numpy as np

h, w = map(int, input().split())
s = np.array([list(input()) for _ in range(h)]) == '.'

L = np.zeros((h, w), dtype=int)
R = np.zeros((h, w), dtype=int)
U = np.zeros((h, w), dtype=int)
D = np.zeros((h, w), dtype=int)

for i in range(h):
    D[i] = (D[i-1]+1) * s[i]
    U[-i-1] = (U[-i]+1) * s[-i-1]

for i in range(w):
    R[:, i] = (R[:, i-1]+1) * s[:, i]
    L[:, -i-1] = (L[:, -i]+1) * s[:, -i-1]


print(np.max(D+U+R+L)-3)
### BUGGY CODE ###

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

    # 距離の最大値を求める．
    max_dist = 0
    for i in range(N):
        for j in range(N):
            # 時計回りの距離
            dist1 = abs(A[i] - A[j])
            # 反時計回りの距離
            dist2 = K - dist1
            if(dist1 < dist2):
                dist_tmp = dist1
                flg = True
            else:
                dist_tmp = dist2
                flg = False
            if(dist_tmp > max_dist):
                max_dist = dist_tmp
                max_index = i, j
                max_flg = flg
    k = 0
    for k in range(N):
        if(k == max_index[0] or k == max_index[1]):
            continue
        if(abs(A[max_index[0]] - A[k] <= max_dist and  abs(A[max_index[1]] - A[k] <= max_dist))):
            if(flg):
                ans = max_dist
            else:
                ans = K - max_dist
        else:
            if(flg):
                ans = K - max_dist
            else:
                ans = max_dist
        break
    print(ans)


if __name__ == "__main__":
    solve()

### FIXED CODE ###

def solve():
    K, N = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A.sort()

    max_dist = 0
    for i in range(1, N):
        dist_tmp = A[i] - A[i-1]
        if(dist_tmp > max_dist):
            max_dist = dist_tmp
    dist_over_zero = K - (A[N-1] - A[0])
    if(dist_over_zero > max_dist):
        ans = K - dist_over_zero
    else:
        ans = K - max_dist
    print(ans)


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

n,m=map(int,input().split())
costs_li=[]
costs_list=[]
limit_li=[]
total_li=[]
bought=0
pay=0
for i in range (1,n+1):
  cost,limit=map(int,input().split())
  costs_li.append(cost)
  costs_list.append(cost)
  limit_li.append(limit)
  total_li.append(cost*limit)
costs_li.sort()
low_li=[]
for j in range(0,n):
    for k in range (0,n):
        if costs_list[k]==costs_li[j]:
            low_li.append(k)
for l in range(0,n+1):
    if bought<m:
        pay=pay+total_li[low_li[l]]
        bought=bought+limit_li[low_li[l]]
    elif bought>m:
        pay=pay-costs_li[l-1]*(bought-m)
        bought=m
    else:
        pay=pay
        bought=bought
print(pay)

### FIXED CODE ###

n,k=map(int,input().split())
li=[]
for i in range (0,n):
  li.append(list(map(int,input().split())))
li.sort()
bought=0
pay=0
t=0
while bought<k:
  pay=pay+(li[t][0])*(li[t][1])
  bought=bought+li[t][1]
  t=t+1
pay=pay-li[t-1][0]*li[t-1][1]
bought=bought-li[t-1][1]
bought_2=k-bought
pay_2=li[t-1][0]*bought_2
pay=pay+pay_2
print(pay)
### BUGGY CODE ###

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

total=0
for i in range(N-1):
    for j in range(i+1,N):
        total+=(A[i]*A[j])%(1000000007)
print(total%(1000000007))


### FIXED CODE ###

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

mod = 10 ** 9 + 7

sum_a=0
for i in A:
    sum_a+=i
    sum_a%=mod

total=0
for i in range(N - 1):
    sum_a -= A[i]
    total+=A[i]*(sum_a)
    total%=mod
print(total)
### BUGGY CODE ###

def main():
    s = input()
    n = len(s)
    k = int(input())
    # dp[使った回数][左端からの距離][左端]
    dp = [[[1]*(n-i) for i in range(n)] for _ in range(k+1)]

    if n == 1:
        print(1)
        return
    dp2 = dp[0][1]
    for i in range(n-1):
        if s[i] == s[i+1]:
            dp2[i] = 2
    if k > 0:
        for cnt in range(1, k+1):
            dp2 = dp[cnt][1]
            for i in range(n-1):
                dp2[i] = 2

    for cnt in range(k):
        dp2 = dp[cnt]
        dp4 = dp[cnt+1]
        for d in range(2, n):
            dp3 = dp2[d]
            dp5 = dp2[d-1]
            dp6 = dp2[d-2]
            dp7 = dp4[d]
            for left in range(n-d):
                right = left+d
                plus = (s[left] == s[right])*2
                dp3[left] = max(
                    dp3[left], dp5[left],
                    dp5[left+1], dp6[left+1]+plus)
                dp7[left] = max(
                    dp7[left], dp3[left], dp6[left+1]+2)
    dp2 = dp[k]
    for d in range(2, n):
        dp3 = dp2[d]
        dp4 = dp2[d-1]
        dp5 = dp2[d-2]
        for left in range(n-d):
            right = left+d
            plus = (s[left] == s[right])*2
            dp3[left] = max(
                dp3[left], dp4[left], dp4[left+1], dp5[left+1]+plus)
    print(dp[-1][-1][0])


main()


### FIXED CODE ###

def main():
    s = input()
    n = len(s)
    k = int(input())
    # dp[使った回数][左端からの距離][左端]
    dp = [[[1]*(n-i) for i in range(n)] for _ in range(k+1)]

    for i in range(n-1):
        if s[i] == s[i+1]:
            dp[0][1][i] = 2
    if k > 0:
        for cnt in range(1, k+1):
            for i in range(n-1):
                dp[cnt][1][i] = 2

    for cnt in range(k):
        for d in range(2, n):
            for left in range(n-d):
                right = left+d
                plus = (s[left] == s[right])*2
                dp[cnt][d][left] = max(
                    dp[cnt][d][left], dp[cnt][d-1][left],
                    dp[cnt][d-1][left+1], dp[cnt][d-2][left+1]+plus)
                dp[cnt+1][d][left] = max(
                    dp[cnt+1][d][left], dp[cnt][d][left], dp[cnt][d-2][left+1]+2)
    for d in range(2, n):
        for left in range(n-d):
            right = left+d
            plus = (s[left] == s[right])*2
            dp[k][d][left] = max(
                dp[k][d][left], dp[k][d-1][left], dp[k][d-1][left+1], dp[k][d-2][left+1]+plus)
    print(dp[-1][-1][0])


main()
### BUGGY CODE ###

from collections import Counter

def flatten_2dim(array):
    return [item for sublist in array for item in sublist]

n, x, y = map(int, input().split())
c = [[float("inf")]*n for i in range(n)]
for i in range(n):
    c[i-1][i] = 1
    c[i][i-1] = 1
c[-1][0] = float("inf")
c[0][-1] = float("inf")
c[x-1][y-1] = 1
c[y-1][x-1] = 1

for k in range(n):
    for i in range(n):
        for j in range(n):
            c[i][j]=min(c[i][j],c[i][k]+c[k][j])
            c[j][j]=0

counter = Counter(flatten_2dim(c))
t = 0
for _, cnt in sorted(counter.items(), key=lambda x: x[0])[1:]:
    print(cnt // 2)
    t += 1
for _ in range(n-1-t):
  print(0)

### FIXED CODE ###

#!/usr/bin/env python3
n, x, y = map(int, input().split())
a = abs
d = [0] * n
for i in range(1, n+1):
    for j in range(i + 1, n+1):
        d[min(j-i, a(x-i)+a(y-j)+1, a(x-j)+a(y-i)+1)] += 1
print(*d[1:], sep="\n")
### BUGGY CODE ###

n, k = map(int, input().split())
if k == 1:
    print(0)
elif k == 2:
    if n % 2 == 0:
        print(0)
    else:
        print(1)
elif k == 3:
    if n%3 == 0:
        print(0)
    elif n%3 == 1:
        print(1)
    else:
        print(2)
else:
    while n > k:
        n = n-k
    if n < k-n:
        print(n)
    else:
        print(k-n)

### FIXED CODE ###

n, k = map(int, input().split())
if n < k:
    if n < k-n:
        print(n)
    else:
        print(k-n)
else:
    n = n%k
    if n < k-n:
        print(n)
    else:
        print(k-n)
### BUGGY CODE ###

from fractions import gcd
def lcm(a, b):
    return a * b // gcd(a, b)
N, M = map(int, input().split())
B = set(map(int, input().split()))
power = 1
for b in B:
    if b == 2:
        continue
    power = lcm(power, b//2)

mn = min(B)

mn2 = mn // 2
p2 = power // mn2

if p2 % 2 == 0:
    print(0)
    exit()
ans1 = M // mn2 // p2
ans2 = M // mn2 // (p2*2)
print(ans1-ans2)


### FIXED CODE ###

from fractions import gcd
def lcm(a, b):
    return a * b // gcd(a, b)
N, M = map(int, input().split())
B = set(map(lambda x: int(x)//2, input().split()))
power = 1
for b in B:
    power = lcm(power, b)

mn = min(B)
p2 = power // mn

if p2 % 2 == 0:
    print(0)
    exit()
ans1 = M // mn // p2
ans2 = M // mn // (p2 * 2)
print(ans1-ans2)
### BUGGY CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

r,g,b,n = iim()
ans = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        num = n-i*r-j*g
        if num%b == 0 and num//b >= 0:
#            print(i,j,num//b)
            ans += 1
print(ans)

### FIXED CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

r,g,b,n = iim()
ans = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        num = n-i*r-j*g
        if num%b == 0 and num//b >= 0:
#            print(i,j,num//b)
            ans += 1
print(ans)
### BUGGY CODE ###

#然列挙では間に合わない
N,C = map(int,input().split())
ld = [[]]
for i in range(C):
  ld.append([0]+list(map(int,input().split())))
lc = [[]]  
for i in range(N):
  lc.append([0]+list(map(int,input().split())))

#前処理
lmae = [[0 for i in range(C+1)] for j in range(3)]
for p in range(1,N+1):
  for q in range(1,N+1):
    for i in range(1,C+1):
      X = lc[p][q]
      Y = i
      lmae[(p+q)%3][i] += ld[X][Y]

#こたえ作り
lans = []
for i in range(1,C+1):
  for j in range(i+1,C+1):
    for k in range(j+1,C+1):
      for cc in [[0,1,2],[0,2,1],[1,0,2],[1,2,0],[2,0,1],[2,1,0]]:
        ans = lmae[cc[0]][i]+lmae[cc[1]][j]+lmae[cc[2]][k]
        lans.append(ans)
print(min(lans))      

### FIXED CODE ###

#然列挙では間に合わない
N,C = map(int,input().split())
ld = [[]]
for i in range(C):
  ld.append([0]+list(map(int,input().split())))
lc = [[]]  
for i in range(N):
  lc.append([0]+list(map(int,input().split())))

#前処理
lmae = [[0 for i in range(C+1)] for j in range(3)]
for p in range(1,N+1):
  for q in range(1,N+1):
    for i in range(1,C+1):
      X = lc[p][q]
      Y = i
      lmae[(p+q)%3][i] += ld[X][Y]

#こたえ作り
lans = []
for i in range(1,C+1):
  for j in range(i+1,C+1):
    for k in range(j+1,C+1):
      for cc in [[0,1,2],[0,2,1],[1,0,2],[1,2,0],[2,0,1],[2,1,0]]:
        ans = lmae[cc[0]][i]+lmae[cc[1]][j]+lmae[cc[2]][k]
        lans.append(ans)
print(min(lans))
### BUGGY CODE ###

from copy import deepcopy

n = int(input().strip())
a = list(map(int, input().split()))
b = deepcopy(a)
b.sort()
counts = {}
tmp = b[0]
for elem in b:
    if str(elem) in counts:
        counts[str(elem)] += 1
    else:
        counts[str(elem)] = 1
    if tmp != elem:
        tmp = elem
c = deepcopy(counts)
for k, v in c.items():
    c[k] = v * (v - 1) // 2
for elem in a:
    print(sum(c.values()) - c[str(elem)] + ((counts[str(elem)] - 1) * (counts[str(elem)] - 2) // 2))


### FIXED CODE ###

from copy import deepcopy

n = int(input().strip())
a = list(input().split())
b = deepcopy(a)
counts = {}
tmp = b[0]
for elem in b:
    if elem in counts:
        counts[elem] += 1
    else:
        counts[elem] = 1
    if tmp != elem:
        tmp = elem
c = deepcopy(counts)
for k, v in counts.items():
    c[k] = v * (v - 1) // 2
su = sum(c.values())
for elem in a:
    print(su - c[elem] + ((counts[elem] - 1) * (counts[elem] - 2) // 2))
### BUGGY CODE ###

N = int(input())
p = [0] + list(input().split())

for i in range(1, N+1):
    item = p[i].replace('0.', '')
    p[i] = int(item)

#print(p)

dp = [[0 for a in range(3100)] for b in range(3100)]
#dp[i][j] = i枚目までのコインを投げて，表の個数がj枚である確率 * (10**(2*i))

dp[1][0] = 100-p[1]
dp[1][1] = p[1]

for i in range(2, N + 1):
    for j in range(i+1):
        dp[i][j] = (dp[i-1][j-1] * p[i] + dp[i-1][j] * (100-p[i])) // 10 ** max(0, i-10)
        #dp[i][j] = i-1枚目までで表がj-1かつi回目で表　＋　i-1回目までで表がj枚かつi回目で裏（MECE）
        #print(i, j, dp[i][j])
        #プログラムの仕組み上，iが一つ進むと，100 * 100 = 10**4　ずつスケールが大きくなっていく。10**20で打ち切る。


ans = 0

for k in range(-(-N//2), N+1):
    ans += dp[N][k]

dig = min(2*N, 10)

print(ans/10**dig)

### FIXED CODE ###

import numpy as np

N = int(input())
p = [0] + list(map(float, input().split()))

dp = np.zeros((3100, 3100))
#dp[i, j] = i枚目までのコインを投げて，表の個数がj枚である確率
#pythonのlistだと遅いので，numpyにおけるベクトル漸化式としてdpを埋めていく

dp[1, 0] = 1-p[1]
dp[1, 1] = p[1]

for i in range(2, N + 1):
    dp[i] = np.roll(dp[i-1], 1) * p[i] + dp[i-1] * (1-p[i])
    #dp[i][j] = i-1枚目までで表がj-1かつi回目で表　＋　i-1回目までで表がj枚かつi回目で裏（MECE）
    #つまり，dp[i][j] = dp[i-1][j-1] * p[i] + dp[i-1][j] * (1 - p[i])
    #numpyを使ってベクトル漸化式と見ることで，for_loopを一層分解消。
    #print(i, j, dp[i][j])

ans = 0

for k in range(-(-N//2), N+1):
    ans += dp[N, k]

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

N = int(input())
S = input()
#dp[i][j] S[i-x:i+1]==S[j-x:j+1]となる最大のx
dp = [[0] * (N + 1) for _ in range(N + 1)]
ans = 0
for i in range(N - 1):
    for j in range(i+1,N):
        if S[i] == S[j]:
            dp[i][j] = min(j - i, dp[i - 1][j - 1] + 1)
            ans = max(ans, max(dp[i]))
print(ans)


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
### BUGGY CODE ###

import numpy as np
n = int(input())
a = np.array([x+1 for x in range(n)])
b = np.array([x+1 for x in range(1,n)]+[1])

c = a%b
print(sum(c))

### FIXED CODE ###

n = int(input())
print((n*(n-1)//2))
### 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)
a = [[-a[i]*f[i], a[i], f[i]] for i in range(n)]
import heapq
heapq.heapify(a)

for i in range(k):
    h = heapq.heappop(a)
    if h[1] > 0:
        h[1] -= 1
        h[0] = -h[2]*h[1]
        heapq.heappush(a, h)
    else:
        heapq.heappush(a, h)
        break

result = heapq.heappop(a)
print(-result[0])


### FIXED CODE ###

def main():

    import numpy as np
    
    n, k = map(int, input().split())
    a = np.array(input().split(), np.int64)
    f = np.array(input().split(), np.int64)
    a.sort()
    a = a[::-1]
    f.sort()
    right = np.max(a*f)
    left = 0
    while right > left:
        middle = (right + left)//2
        b = 0
        
        if np.sum(np.maximum(a-middle//f, 0)) <= k:
            right = middle
        else:
            left = middle+1

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

import sys
input = sys.stdin.readline

N=int(input())
POINT=[list(map(int,input().split())) for i in range(N)]
mod=998244353

PX=[p[0] for p in POINT]
PY=[p[1] for p in POINT]

compression_dict_x={a: ind for ind, a in enumerate(sorted(set(PX)))}
compression_dict_y={a: ind for ind, a in enumerate(sorted(set(PY)))}

for i in range(N):
    POINT[i]=[compression_dict_x[POINT[i][0]]+1,compression_dict_y[POINT[i][1]]+1]


P_Y=sorted(POINT,key=lambda x:x[1])

# BIT(BIT-indexed tree)

LEN=len(compression_dict_x)# 必要なら座標圧縮する

BIT=[0]*(LEN+1)# 1-indexedなtree

def update(v,w):# vにwを加える
    while v<=LEN:
        BIT[v]+=w
        v+=(v&(-v))# 自分を含む大きなノードへ. たとえばv=3→v=4

def getvalue(v):# [1,v]の区間の和を求める
    ANS=0
    while v!=0:
        ANS+=BIT[v]
        v-=(v&(-v))# 自分より小さい2ベキのノードへ. たとえばv=3→v=2へ
    return ANS


ALL = pow(2,N,mod)-1

ANS= ALL*N%mod

for i in range(N):
    ANS = (ANS - (pow(2,i,mod) -1)*4)%mod

for i in range(N):
    x,y=P_Y[i]
    up=getvalue(x)

    ANS=(ANS+pow(2,up,mod)+pow(2,i-up,mod)-2)%mod

    update(x,1)

P_Y2=P_Y[::-1]
BIT=[0]*(LEN+1)

for i in range(N):
    x,y=P_Y2[i]
    down=getvalue(x)

    ANS=(ANS+pow(2,down,mod)+pow(2,i-down,mod)-2)%mod

    update(x,1)


print(ANS)


### FIXED CODE ###

import sys
input = sys.stdin.readline

N=int(input())
POINT=[list(map(int,input().split())) for i in range(N)]
mod=998244353

PX=[p[0] for p in POINT]
PY=[p[1] for p in POINT]

compression_dict_x={a: ind for ind, a in enumerate(sorted(set(PX)))}
compression_dict_y={a: ind for ind, a in enumerate(sorted(set(PY)))}

for i in range(N):
    POINT[i]=[compression_dict_x[POINT[i][0]]+1,compression_dict_y[POINT[i][1]]+1]


P_Y=sorted(POINT,key=lambda x:x[1])

# BIT(BIT-indexed tree)

LEN=len(compression_dict_x)# 必要なら座標圧縮する

BIT=[0]*(LEN+1)# 1-indexedなtree

def update(v,w):# vにwを加える
    while v<=LEN:
        BIT[v]+=w
        v+=(v&(-v))# 自分を含む大きなノードへ. たとえばv=3→v=4

def getvalue(v):# [1,v]の区間の和を求める
    ANS=0
    while v!=0:
        ANS+=BIT[v]
        v-=(v&(-v))# 自分より小さい2ベキのノードへ. たとえばv=3→v=2へ
    return ANS


ALL = pow(2,N,mod)-1

ANS= ALL*N%mod

for i in range(N):
    ANS = (ANS - (pow(2,i,mod) -1)*4)%mod

for i in range(N):
    x,y=P_Y[i]
    up=getvalue(x)

    ANS=(ANS+pow(2,up,mod)+pow(2,i-up,mod)-2)%mod

    update(x,1)

P_Y2=P_Y[::-1]
BIT=[0]*(LEN+1)

for i in range(N):
    x,y=P_Y2[i]
    down=getvalue(x)

    ANS=(ANS+pow(2,down,mod)+pow(2,i-down,mod)-2)%mod

    update(x,1)


print(ANS)
### BUGGY CODE ###

import collections
    
N=int(input())
S=str(input())
#W=左
#E=右
ans=[]
for i in range(1,N-1):        
    c1=collections.Counter(S[0:i-1])
    c2=collections.Counter(S[i:N])
    ans.append(c1["W"]+c2["E"])
     
print(min(ans))

### FIXED CODE ###

N=int(input())
S=str(input())
#W=左
#E=右
ans=[]
count=0
#一番左
for i in range(1,N):
    
    if S[i]=="E":
        count+=1    
        
        
ans.append(count)


for i in range(1,N):
    
    if S[i-1]=="W":
        count+=1
    if S[i]=="E":
        count-=1

    ans.append(count)

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

import itertools
N=int(input())
L=list(map(int,input().split()))

p=itertools.combinations(L,3)
total=0
for e in p:
    a=e[0]
    b=e[1]
    c=e[2]
    if(a < b + c and b < c + a and c < a + b):
        total+=1
print(total)


### FIXED CODE ###

import sys
from bisect import bisect_left
N=int(input())
L=list(map(int,input().split()))
L.sort()
total = 0
for i in range(N):
  for j in range(i + 1, N):
    a = L[i] + L[j]
    total += max(bisect_left(L, a) - j - 1, 0)

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

S = input()[::-1]
sum_of_mod = [0] * 2019
now = int(S[0])
digit = 1
sum_of_mod[now % 2019] += 1
for c in S:
    now = int(c)*(10**digit) + now
    sum_of_mod[now % 2019] += 1
    digit += 1
ans = 0
for m in sum_of_mod:
    ans += m * (m-1) // 2
print(ans)


### FIXED CODE ###

S = input()[::-1]
N = len(S)
sum_of_mod = [0] * 2019
sum_of_mod[0] += 1
digit = 1
now = 0
for i in range(N):
    now = int(S[i])*digit + now
    now %= 2019
    digit *= 10
    digit %= 2019
    sum_of_mod[now] += 1

ans = 0
for i in range(2019):
    ans += sum_of_mod[i] * (sum_of_mod[i]-1) // 2
print(ans)
### BUGGY CODE ###

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return len(lower_divisors + upper_divisors[::-1])
N=int(input())
ans=0
for i in range(1,N+1):
  ans+=make_divisors(i)*i
print(ans)

### FIXED CODE ###

N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)
### BUGGY CODE ###

N=int(input())
a=list(map(int,input().split()))
o=[]
for i in range(N):
    o.append(a.index(i+1)+1)
print(*o)

### FIXED CODE ###

def solve(string):
    n, *a = map(int, string.split())
    ans = [0] * n
    for i, _a in enumerate(a, 1):
        ans[_a - 1] = str(i)
    return " ".join(ans)


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))