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

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int
D = dict()


def solve(L: str):
    p = len(L)
    
    D['0'] = 1
    D['1'] = 3
    s = ''
    for i, c in enumerate(L[::-1]):
        s_next = c + s
        if len(s_next) == 1:
            s = s_next
            continue
        if c == '0':
            D[s_next] = D[s]
        else:
            D[s_next] = (pow(3, i, MOD) + D[s] * 2) % MOD
        s = s_next
    print(D[L])
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    L = next(tokens)  # type: int
    solve(L)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int

def powmod(a, n, m):
    L = [1 for _ in range(n+1)]
    for i in range(n):
        L[i+1] = L[i] * a % m
    return L

def solve(L: str):
    p = len(L)
    pm = powmod(3, p, MOD)
    
    s = ''
    for i, c in enumerate(L[::-1]):
        if i == 0:
            if c == '1':
                res = 3
            else:
                res = 1
            continue
        
        if c == '0':
            res = res
        else:
            res = (pm[i] + res * 2) % MOD
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    L = next(tokens)  # type: int
    solve(L)

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

from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,k = inpl()
now = inpl() + [0]
for _ in range(k):
    pre = now[::]
    now = [0] * (n+1)
    for j in range(n):
        a = max(0,j-pre[j])
        b = min(n,j+pre[j]+1)
        now[a] += 1
        now[b] -= 1
    x = 0
    mi = 0
    for j in range(n):
        x += now[j]
        now[j] = x
        mi = min(x,mi)
    if mi == n:
        break
print(*now[:n])

### FIXED CODE ###

from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,k = inpl()
now = inpl()
now.append(0)
for _ in range(k):
    pre = now[::]
    now = [0] * (n+1)
    for j in range(n):
        a = max(0,j-pre[j])
        b = min(n,j+pre[j]+1)
        now[a] += 1
        now[b] -= 1
    x = 0
    mi = INF
    for j in range(n):
        x += now[j]
        mi = min(mi,x)
        now[j] = x
    if mi == n:
        break
print(*now[:n])
### BUGGY CODE ###

import sys, math
from pprint import pprint
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

S = rs()

mods = []
n = 0
e = 0
r = 0
for i in reversed(range(len(S))):
	n = int(S[i:])
	r = 2019
	m = n % r
	mods.append(m)
mods.append(0)
import collections
cnt = collections.Counter(mods)
ans = 0
for k, c in cnt.items():
	ans += c*(c-1)//2
print(ans)


### FIXED CODE ###

import sys, math
from pprint import pprint
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

S = rs()

mods = []
n = 0
e = 1
for i in reversed(range(len(S))):
	n += int(S[i]) * e
	e = (e*10) % 2019
	n = n % 2019
	mods.append(n)
mods.append(0)
import collections
cnt = collections.Counter(mods)
ans = 0
for k, c in cnt.items():
	ans += c*(c-1)//2
print(ans)
### BUGGY CODE ###

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

used = {}
used[0] = 0
gg = {}

def dfs(n, a, b, c, d):
    global used
    # print(n)
    if n in used: return used[n]
    ret = n*d
    for i in range(-4, 4):
        now = n + i
        if now%2==0 and now > 0 and abs(i) < 2: ret = min(ret, abs(i)*d + a + dfs(now//2, a, b, c, d))
        if now%3==0 and now > 0 and abs(i) < 3: ret = min(ret, abs(i)*d + b + dfs(now//3, a, b, c, d))
        if now%5==0 and now > 0: ret = min(ret, abs(i)*d + c + dfs(now//5, a, b, c, d))
    return ret

def solve():
    n,a,b,c,d = NextInts()
    global used
    used = {}
    gg = {}
    used[0] = 0
    used[1] = d
    used[2] = min(d*2, d+a)
    return dfs(n, a, b, c,d)
    
def main():
    t = NextInt()
    ans = [solve() for i in range(t)]
    for i in range(t):
        print(ans[i])

if __name__ == "__main__":
    main()


### FIXED CODE ###

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

used = {}
used[0] = 0
gg = {}

def dfs(n, a, b, c, d):
    global used
    # print(n)
    if n in used: return used[n]
    ret = n*d
    for i in range(-4, 4):
        now = n + i
        if now%2==0 and now > 0 and abs(i) < 2: ret = min(ret, abs(i)*d + a + dfs(now//2, a, b, c, d))
        if now%3==0 and now > 0 and abs(i) < 3: ret = min(ret, abs(i)*d + b + dfs(now//3, a, b, c, d))
        if now%5==0 and now > 0: ret = min(ret, abs(i)*d + c + dfs(now//5, a, b, c, d))
    used[n] = ret
    return ret
        


def solve():
    n,a,b,c,d = NextInts()
    global used
    used = {}
    gg = {}
    used[0] = 0
    used[1] = d
    used[2] = min(d*2, d+a)
    return dfs(n, a, b, c,d)
    
def main():
    t = NextInt()
    ans = [solve() for i in range(t)]
    for i in range(t):
        print(ans[i])

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

from collections import deque

h,w = map(int,input().split())
ch,cw = map(int,input().split())
dh,dw = map(int,input().split())

c = [[] for i in range(h)]

for i in range(h):
    c[i] = input()
    
d = [[10000000 for i in range(w)] for j in range(h)]
    
d[ch-1][cw-1] = 0
que = deque([[ch-1,cw-1]])

dx = [1,0,-1,0]
dy = [0,1,0,-1]
ddx = [1,1,-1,-1,2,2,2,2,2,1,1,0,0,-1,-1,-2,-2,-2,-2,-2]
ddy = [1,-1,1,-1,2,1,0,-1,-2,2,-2,2,-2,2,-2,2,1,0,-1,-2]
    
while que:
    y,x = que.popleft()
        
    for k in range(4):
        nx = x + dx[k]
        ny = y + dy[k]
            
        if 0<=nx and nx<w and 0<=ny and ny<h and c[y][x] != '#':
            if d[ny][nx] > d[y][x]:
                d[ny][nx] = d[y][x]
                que.append([ny,nx])
                
    for k in range(20):
        nx = x + ddx[k]
        ny = y + ddy[k]
            
        if 0<=nx and nx<w and 0<=ny and ny<h and c[y][x] != '#':
            if d[ny][nx] > d[y][x] + 1:
                d[ny][nx] = d[y][x] + 1
                que.append([ny,nx])

                
if d[dh-1][dw-1] == 10000000:
    print(-1)
else:
    print(d[dh-1][dw-1])

### FIXED CODE ###

from collections import deque

h,w = map(int,input().split())
ch,cw = map(int,input().split())
dh,dw = map(int,input().split())

c = [[] for i in range(h)]

for i in range(h):
    c[i] = input()
    
d = [[10000000 for i in range(w)] for j in range(h)]
    
d[ch-1][cw-1] = 0
que = deque([[ch-1,cw-1]])

dx = [1,0,-1,0]
dy = [0,1,0,-1]
ddx = [1,1,-1,-1,2,2,2,2,2,1,1,0,0,-1,-1,-2,-2,-2,-2,-2]
ddy = [1,-1,1,-1,2,1,0,-1,-2,2,-2,2,-2,2,-2,2,1,0,-1,-2]
    
while que:
    y,x = que.popleft()
        
    for k in range(4):
        nx = x + dx[k]
        ny = y + dy[k]
            
        if 0<=nx and nx<w and 0<=ny and ny<h and c[ny][nx] != '#':
            if d[ny][nx] > d[y][x]:
                d[ny][nx] = d[y][x]
                que.appendleft([ny,nx])
                
    for k in range(20):
        nx = x + ddx[k]
        ny = y + ddy[k]
            
        if 0<=nx and nx<w and 0<=ny and ny<h and c[ny][nx] != '#':
            if d[ny][nx] > d[y][x] + 1:
                d[ny][nx] = d[y][x] + 1
                que.append([ny,nx])

                
if d[dh-1][dw-1] == 10000000:
    print(-1)
else:
    print(d[dh-1][dw-1])
### BUGGY CODE ###

n = int(input())

print(0 if n == 1 else sum([(i - 1)%i for i in range(2, n + 1)]))

### FIXED CODE ###

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

from collections import deque


def main():
    K = int(input())
    q = deque([(1, 1)])
    visited = [False] * K
    while len(q):
        n, s = q.popleft()
        if n % K == 0:
            print(s)
            return
        if visited[n % K]:
            continue
        visited[n % K] = True
        if not visited[n*10 % K]:
            q.appendleft((n*10, s))
        if not visited[(n+1) % K]:
            q.append((n+1, s+1))


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque


def main():
    K = int(input())
    q = deque([(1, 1)])
    visited = [False] * K
    while len(q):
        n, s = q.popleft()
        if visited[n]:
            continue
        visited[n] = True
        if n == 0:
            print(s)
            return
        q.appendleft((n*10 % K, s))
        q.append(((n+1) % K, s+1))


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

N = int(input())
T = [0]*100000
X= [0]*100000
Y= [0]*100000
x = 0
y = 0

for n in range(N):
        T[n],X[n],Y[n] = (map(int, input().split()))

flag = 1
for n in range(N):
    #print(n)
    if flag == 0:
        continue


    if n == 0:
        count = T[n]
    else:
        count = T[n] - T[n-1]
        x = X[n-1]
        y = Y[n-1]
    c = 0
    end = 0
    while True:
        if end == 1:
            break
        s_x = X[n] - x
        s_y = Y[n] - y
        #print(str(x)+' '+str(y))

        if ((s_x >= 0 or s_y >= 0) )and (c!=count):
            if s_x >0:
                x +=1
                c += 1
            elif s_x < 0:
                x -= 1
                c+=1
            elif s_y > 0:
                y +=1
                c += 1
            elif s_y < 0:
                y -= 1
                c+=1
            elif s_x==0:
                c +=2
        elif c==count:
            if (x == X[n] and y ==Y[n]):
                flag = 1
                end=1
            else:
                flag=0
                end =1
        elif c>count:
            flag = 0
            end = 1


if flag == 1:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

N = int(input())
T = [0]*100000
X= [0]*100000
Y= [0]*100000
x = 0
y = 0

for n in range(N):
        T[n],X[n],Y[n] = (map(int, input().split()))

flag = 1
for n in range(N):
    #print(n)
    if flag == 0:
        continue


    if n == 0:
        count = T[n]
    else:
        count = T[n] - T[n-1]
        x = X[n-1]
        y = Y[n-1]
    c = 0
    end = 0
    while True:
        if end == 1:
            break
        s_x = X[n] - x
        s_y = Y[n] - y
    #    print(str(s_x)+' '+str(s_y))

        if ((s_x != 0 or s_y !=0) )and (c!=count):
            if s_x >0:
                x +=1
                c += 1
            elif s_x < 0:
                x -= 1
                c+=1
            elif s_y > 0:
                y +=1
                c += 1
            elif s_y < 0:
                y -= 1
                c+=1
        elif  ((s_x == 0 and s_y == 0) )and (c!=count):
                x +=1
                c +=1
        elif c==count:
            if (x == X[n] and y ==Y[n]):
                flag = 1
                end=1
            else:
                flag=0
                end =1



if flag == 1:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

#!/usr/bin/env python3
import sys


def solve(S: str):
    n = len(S)
    while True:
        l = len(S)
        for i in range(len(S) - 1):
            if S[i] != S[i + 1]:
                S = S[:i] + S[i + 2:]
                break
        if l == len(S):
            break
    print(n - len(S))
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    solve(S)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(S: str):
    n = len(S)
    while True:
        l = len(S)
        i = 0
        while True:
            if i >= len(S) - 1:
                break
            if S[i] != S[i + 1]:
                S = S[:i] + S[i + 2:]
                i = max(i - 1, 0)
            else:
                i += 1
        if l == len(S):
            break
    print(n - len(S))
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    solve(S)

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

import math
n=int(input())
m=int(math.sqrt(n)+1)
a=[]
for x in range(1,m):
  for y in range(1,m):
    for z in range(1,m):
      a.append(int(x**2+y**2+z**2+x*y+y*z+z*x))
for i in range(1,1+n):
  print(a.count(i))

### FIXED CODE ###

import math
import collections
n=int(input())
m=int(math.sqrt(n)+1)
a=[]
for x in range(1,m):
  for y in range(1,m):
    for z in range(1,m):
      if x**2+y**2+z**2+x*y+y*z+z*x<=n:
        a.append(x**2+y**2+z**2+x*y+y*z+z*x)
c=collections.Counter(a)
for i in range(1,n+1):
  print(c[i])
### BUGGY CODE ###

def main():
    N = int(input())
    L = list(map(int, input().split()))

    L = sorted(L)
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i]+L[j] > L[k]:
                    ans += 1
                else:
                    break
    print(ans)
    return 0

if __name__ == '__main__':
    main()

### FIXED CODE ###

import bisect

def main():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)

    ans = 0

    for i in range(N):
        for j in range(i+1, N):
            X = L[i] + L[j]
            l = bisect.bisect_left(L, X, lo=j+1)
            ans += (l-(j+1))
            #print(L[j + 1:l])
    print(ans)
    return 0

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

import numpy as np
n = int(input())
aa = np.array(input().split(), dtype='int')
ma = np.max(aa)
cnt = np.zeros(max(aa)+1, dtype='int')

for a in aa:
    cnt[a] += 1

if np.gcd.reduce(aa) != 1:
    print('not coprime')

elif np.all([cnt[i::i].sum() <= 1 for i in range(2, ma)]):
    print('pairwise coprime')
else:
    print('setwise coprime')

### FIXED CODE ###

from math import gcd, sqrt, ceil
from functools import reduce

def sieve(n):
    A = list(range(n+1))
    for i in range(2, n+1 ,2):
        A[i] = 2
    for j in range(3, ceil(sqrt(n+1))+1, 2)[::-1]:
        for i in range(j, n+1, j):
            A[i] = j
    return A

def factorize(n, A):
    factors = set()
    while n != 1:
        f = A[n]
        factors.add(f)
        n //= f
    return factors

_, *aa = map(int, open(0).read().split())

def main(aa):
    pair_co = True
    A = sieve(10**6)
    all_factors = [0] * (10**6+1)
    for a in aa:
        factors = factorize(a, A)
        for factor in factors:
            if all_factors[factor]:
                pair_co = False
                break
            else:
                all_factors[factor] = 1
        if not pair_co:
            break
    if pair_co:
        return 'pairwise coprime'
    elif reduce(gcd, aa) == 1:
        return 'setwise coprime'
    else:
        return 'not coprime'

print(main(aa))
### BUGGY CODE ###

import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    h, w = list(map(int, readline().split()))
    a = [list(map(int, readline().split())) for _ in range(h)]
    b = [list(map(int, readline().split())) for _ in range(h)]

    diff = [[abs(an - bn) for an, bn in zip(arow, brow)] for arow, brow in zip(a, b)]

    dp = [[set() for _ in range(w)] for _ in range(h)]
    dp[0][0].add(diff[0][0])

    from itertools import product

    for row, col in product(range(h),range(w)):
        curset = set()
        prevset = set()
        curdiff = diff[row][col]

        if row - 1 >= 0:
            prevset |= dp[row - 1][col]
        if col - 1 >= 0:
            prevset |= dp[row][col - 1]

        for num in prevset:
            curset.add(num + curdiff)
            curset.add(abs(num - curdiff))
        dp[row][col] |= curset

    cand = list(dp[h - 1][w - 1])

    print(min(cand))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    h, w = list(map(int, readline().split()))
    a = [list(map(int, readline().split())) for _ in range(h)]
    b = [list(map(int, readline().split())) for _ in range(h)]

    diff = [[abs(an - bn) for an, bn in zip(arow, brow)] for arow, brow in zip(a, b)]

    dp = [[1 << (80 * 160 + 1) for _ in range(w)] for _ in range(h)]
    dp[0][0] |= 1 << diff[0][0]

    from itertools import product

    for row, col in product(range(h), range(w)):
        diff_cur = diff[row][col]
        prevset = 0

        if row - 1 >= 0:
            prevset |= dp[row - 1][col]
        if col - 1 >= 0:
            prevset |= dp[row][col - 1]

        dp[row][col] |= (prevset << diff_cur)
        dp[row][col] |= (prevset >> diff_cur)
        temp = 0
        for i in range(diff_cur):
            if prevset >> i & 1:
                temp += (1 << diff_cur - i)
        dp[row][col] |= temp

    for i in range(12801):
        if dp[h - 1][w - 1] >> i & 1:
            print(i)
            sys.exit()


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

n,m=map(int,input().split())
c=1
if m%n==0:
    print(int(m/n))
else:
    for i in range(m//n,0,-1):
        if m%i==0:
            print(i)
            break

### FIXED CODE ###

n, m = list(map(int,input().split()))
def solve():
    for i in range(m//n, 0, -1):
        if m % i == 0:
            if m//i>= n:
                print(i)
                break
solve()
### BUGGY CODE ###

# 初期入力
N = int(input())
word = [ input() for i in range(N) ]

# 単語をキーに数を数えて辞書
from collections import Counter
kazu_word = Counter(word)

#一番多い単語を抜き出す
kazu_word_max =[i for i,v in kazu_word.items() if v == max(kazu_word.values())]
kazu_word_max_sorted = sorted(kazu_word_max)
"""
print(kazu_word)
print(kazu_word_max)
"""
print(*kazu_word_max_sorted,sep="\n")

### FIXED CODE ###

# 初期入力
N = int(input())
word = [ input() for i in range(N) ]

# 単語をキーに数を数えて辞書
from collections import Counter
kazu_word = Counter(word)

#一番多い単語を抜き出す
kazu_word_a = max(kazu_word.values()) #　内包表記の中で毎回MAXを計算するより出したほうが１回で済む
kazu_word_max =[i for i,v in kazu_word.items() if v == kazu_word_a ]
kazu_word_max_sorted = sorted(kazu_word_max)
"""
print(kazu_word)
print(kazu_word_max)
"""
print(*kazu_word_max_sorted,sep="\n")
### BUGGY CODE ###

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

c = a
for i in range(a+1,b+1):
  c = c^i
print(c)

### FIXED CODE ###

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

bin_b = bin(b)[2:]
bit_len = len(bin_b)
bin_a = bin(a)[2:].zfill(bit_len)

ans_bit = []

a_odd = a + (1 - a%2)
odd_num = (b-a_odd)//2 + 1
if odd_num % 2 == 0:
  ans_bit.append('0')
else:
  ans_bit.append('1')

for i in range(1,bit_len):
  keta = bit_len - i - 1
  amari_a = 0
  if bin_a[keta] == '1':
    amari_a = 2**i - a % 2**i
  amari_b = 0
  if bin_b[keta] == '1':
    amari_b = b % 2**i + 1
  
  no_change = amari_a + amari_b
  if no_change % 2 == 0:
    ans_bit.append('0')
  else:
    ans_bit.append('1')
ans = ''.join(ans_bit[::-1])
ans = int(ans,2)

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

import sys
input=sys.stdin.readline
N=int(input())
a=list(map(int,input().split()))
fl=1
def absX(n):
	ab=abs(i-n)
	if ab==0:
		ab=1
	return ab
for i in range(min(a),max(a)+1):
	fl_=list(map(absX,a)).count(1)
	if fl_>fl:fl=fl_
print(fl)

### FIXED CODE ###

from collections import*
import sys
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
a=Counter(a)
cnt=1
for i in range(min(a),max(a)+1):
	cnt_=a[i-1]+a[i]+a[i+1]
	if cnt_>cnt:cnt=cnt_
print(cnt)
### BUGGY CODE ###

N,Q = map(int, input().split())
AB = []
for i in range(N-1):
  AB.append(list(map(int, input().split())))
P = []
for i in range(Q):
  P.append(list(map(int, input().split())))

Part = [[i] for i in range(N+1)]
tmp = {1}
while (tmp):
  tmp2 = set()
  for i in tmp:
    for j in range(len(AB)):
      if i == AB[j][0]:
        for k in range(1,N+1):
          if i in Part[k]:
            Part[k].append(AB[j][1])
        tmp2.add(AB[j][1])
  tmp = tmp2

Counter = [0] * (N+1)
for i in range(len(P)):
  for j in Part[P[i][0]]:
    Counter[j] += P[i][1]
print(*[Counter[i] for i in range(1,N+1)])  


### FIXED CODE ###

N,Q = map(int, input().split())
Edge = [set() for _ in range(N+1)]
for i in range(N-1):
  e1,e2 = map(int, input().split())
  Edge[e1].add(e2)
  Edge[e2].add(e1)
Counter = [0] * (N+1)
for i in range(Q):
  p,x = map(int, input().split())
  Counter[p] += x

#print(Edge)
  
Visited = [False] * (N+1)
stack = {1}
while (stack):
  stack2 = set()
  for i in range(len(stack)):
    e1 = stack.pop()
    for e2 in Edge[e1]:
      if not Visited[e2]:
        Counter[e2] += Counter[e1]
        stack2.add(e2)
    Visited[e1] = True
  stack = stack2
  #print(Visited)

print(*[Counter[i] for i in range(1,N+1)])
### BUGGY CODE ###

def main():
    N = int(input())
    a = input().split(" ")
    list = []
    for i in range(N):
        list.append([int(a[i]), i + 1])
    list.sort()
    ans = ""
    for i in list:
        ans = ans + str(i[1]) + " "
    print(ans[:len(ans) - 1])


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N = int(input())
    A = map(int, input().split(" "))
    list = [""] * (N + 1)
    for i, a in enumerate(A, 1):
        list[a] = str(i)
    print(" ".join(list[1:]))


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

# C - Linear Approximation
# https://beta.atcoder.jp/contests/abc102/tasks/arc100_a

# C_Linear_Approximation.py

# 7
# 1 1 1 1 2 3 4
#import sys

N = int(input())
a = list(map(int, input().strip().split(" ")))

#sum = 0
max = a[0]-1
min = a[0]-1
for i in range(N):
    a[i] = a[i] - (i+1)
    #sum += a[i]
    if a[i] > max:
        max = a[i]
    if a[i] < min:
        min = a[i]
a.sort()

for b in range(min, max + 1):
    sadness_left = 0
    i = 0
    while a[i] < b:
        sadness_left += b - a[i]
        i += 1
    sadness = sum(a) - b * N + sadness_left * 2
    if b == min:
        min_sadness = sadness
    elif min_sadness > sadness:
        min_sadness = sadness

print(min_sadness)


### FIXED CODE ###

# C - Linear Approximation
# https://beta.atcoder.jp/contests/abc102/tasks/arc100_a

# C_Linear_Approximation.py

# 7
# 1 1 1 1 2 3 4
#import sys

N = int(input())
a = list(map(int, input().strip().split(" ")))

for i in range(N):
    a[i] = a[i] - (i+1)

a.sort()
if N % 2 != 0:
    mid = (N-1)//2
else:
    mid = N // 2 -1
b = a[mid]

sadness_left = b * mid - sum(a[:mid])
sadness = sum(a) - b * N + sadness_left * 2

print(sadness)