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

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

ans=[]
for i in range(1,N+1):
    ans.append(A.index(i) +1)
print(*ans)

### FIXED CODE ###

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

ans=[0]*(N+1)
for i in range(1,N+1):
    ans[A[i]] = i

del ans[0]
print(*ans)
### BUGGY CODE ###

import re
S = (input())
advance = len(S)
ans = 0
while True:  
    count = re.findall("01",S)
    S = S.replace("01","")
    ans+=len(count)*2
    count = re.findall("10",S)
    S = S.replace("10","")
    ans+=len(count)*2
    if advance==len(S):
        break
    advance = len(S)
print(ans)

### FIXED CODE ###

S = [i for i in input()]
zero = S.count("0")
iti = S.count("1")
print(min(zero,iti)*2)
### BUGGY CODE ###

N = int(input())
emp = list(map(int,input().split()))
emp.sort()
# def rem_val(arr, value):
#     while value in arr:
#         try:
#             arr.remove(value)
#         except:
#             break
for i in range(N):
    # if(len(emp)!=0):
    print(emp.count(i+1))
        # rem_val(emp,i+1)
    # else:
    #     print(0)


### FIXED CODE ###

N = int(input())
emp = list(map(int,input().split()))
ans_l = [0]*(N+1)
for i in range(N-1):
    a = emp[i]
    ans_l[a] +=1
for i in range(1,N+1):
    print(ans_l[i])
### BUGGY CODE ###

import bisect
import functools
import os
import sys

import numpy as np

sys.setrecursionlimit(10000)
INF = float('inf')

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


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        ret = fn(*args, **kwargs)
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        print(ret)
        return ret

    return wrapper


@debug
def calc_bit(k):
    """
    答えの下から k ビット目を返す
    :param int k:
    :return:
    """
    # 答えの k ビット目が偶数なら 0、奇数なら 1

    # これ以上の桁は不要
    mod = 1 << (k + 1)
    amod = A % mod
    bmod = B % mod
    bmod.sort()
    ret = 0
    for a in amod:
        # bmod + a のうち k ビット目が 1 となる数
        # => (1 << k) 以上 (2 << k) 未満または (3 << k) 以上 (4 << k) 未満
        ret += bisect.bisect_left(bmod + a, 2 << k) - bisect.bisect_left(bmod + a, 1 << k)
        ret += bisect.bisect_left(bmod + a, 3 << k) - bisect.bisect_left(bmod + a, 4 << k)

    return ret % 2


ans = 0
for i in range(32):
    ans += calc_bit(i) * (2 ** i)
print(ans)


### FIXED CODE ###

import bisect
import functools
import os
import sys

sys.setrecursionlimit(10000)
INF = float('inf')

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


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        ret = fn(*args, **kwargs)
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        print(ret)
        return ret

    return wrapper


@debug
def calc_bit(k):
    """
    答えの下から k ビット目を返す
    :param int k:
    :return:
    """
    # 答えの k ビット目が偶数なら 0、奇数なら 1

    # これ以上の桁は不要
    mod = 1 << (k + 1)
    amod = [a & (mod - 1) for a in A]
    bmod = [b & (mod - 1) for b in B]
    amod.sort()
    bmod.sort()
    ret = 0

    # bmod + amod のうち k ビット目が 1 となる数
    # => (1 << k) 以上 (2 << k) 未満または (3 << k) 以上 (4 << k) 未満
    # しゃくとる
    b01 = bisect.bisect_left(bmod, (1 << k) - amod[0])
    b10 = bisect.bisect_left(bmod, (2 << k) - amod[0])
    b11 = bisect.bisect_left(bmod, (3 << k) - amod[0])
    for a in range(len(amod)):
        while b01 - 1 >= 0 and bmod[b01 - 1] >= (1 << k) - amod[a]:
            b01 -= 1
        while b10 - 1 >= 0 and bmod[b10 - 1] >= (2 << k) - amod[a]:
            b10 -= 1
        while b11 - 1 >= 0 and bmod[b11 - 1] >= (3 << k) - amod[a]:
            b11 -= 1
        # (1 << k) 以上 (2 << k) 未満
        ret += b10 - b01
        # (3 << k) 以上 (4 << k) 未満
        ret += len(bmod) - b11

    return ret % 2


ans = 0
for i in range(30):
    ans += calc_bit(i) * (2 ** i)
print(ans)
### BUGGY CODE ###

v,e,s=map(eval,input().split())
edge=[]
inf =1000000100
for i in range(v):
    edge.append([])

for i in range(e):
    vs,vt,d=map(eval,input().split())
    edge[vs].append((vt,d))
    
dis=[]
for i in range(v):
    dis.append(inf)

dis[s]=0

for j in range(v):
    for i in range(v):
        for (t,d) in edge[i]:
            if d>=inf or dis[i]>=inf: continue
            if dis[t]>dis[i]+d:
                dis[t]=dis[i]+d

for i in range(v):
    if dis[i]>=inf:
        print("INF")
    else:
        print(dis[i])

### FIXED CODE ###

'''
????????£????????????1??????????????????
??\???C++??§????????????????§£?±???????????????????????????????????????§???
??????python??§??????????????????Accept??§??????????????????
????????£??¨optimization??????????????§??????
??§????????????Wrong Answer??§?????????
???????????????????????????????????????????????????
Online Judge???????????????Public Solutions??§
????????????nanae?????????python3????????????????????????
????????£??¨?????????????????????
???????????????????????????0.06?§????????????§??????
'''

import queue
v,e,s=map(int,input().split())
edge=[]
inf =1000000100
for i in range(v):
    edge.append([])

for i in range(e):
    vs,vt,d=map(int,input().split())
    edge[vs].append((vt,d))
    
dis=[]
for i in range(v):
    dis.append(inf)

dis[s]=0

q = queue.PriorityQueue()
q.put((0,s))


while(not q.empty()):
    now=q.get()
    nowv=now[1]
    for (vt,d) in edge[nowv]:
        if dis[vt]>dis[nowv]+d:
            dis[vt]=dis[nowv]+d
            q.put((dis[vt],vt))
'''

finished=0
while(finished<v and not q.empty()):
    now=q.get()
    nowv=now[1]
    if now[0]>dis[nowv]: continue
    for (vt,d) in edge[nowv]:
        if dis[vt]>dis[nowv]+d:
            dis[vt]=dis[nowv]+d
            q.put((dis[vt],vt))
    finished+=1       '''

for i in range(v):
    if dis[i]>=inf:
        print("INF")
    else:
        print(dis[i])
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n = int(input())
s = list(str(input()))
q = int(input())

def segfunc(x,y):
    return x | y

def init(init_val):
    #set_val
    for i in range(n):
        seg[i+num-1]=set(init_val[i])
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=segfunc(seg[2*i+1],seg[2*i+2])

def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[k*2+1],seg[k*2+2])

def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res,seg[p])
        if q&1 == 1:
            res = segfunc(res,seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res,seg[p])
    else:
        res = segfunc(segfunc(res,seg[p]),seg[q])
    return res

#####単位元######
ide_ele = set()

#num:n以上の最小の2のべき乗
num =2**(n-1).bit_length()
seg=[ide_ele]*2*num

init(s)
#print(seg)

for i in range(q):
    t, x, y = map(str, input().split())
    if t == '1':
        i = int(x)-1
        c = set(y)
        update(i, c)
    else:
        l = int(x)-1
        r = int(y)-1
        print(len(query(l, r+1)))


### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
s = list(str(input()))
q = int(input())

s = [ord(c)-ord('a') for c in s]

#def segfunc(x,y):
    #return x | y

def init(init_val):
    #set_val
    for i in range(n):
        seg[i+num-1]={init_val[i]}
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=seg[2*i+1] | seg[2*i+2]

def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = seg[k*2+1] | seg[k*2+2]

def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = res | seg[p]
        if q&1 == 1:
            res = res | seg[q]
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = res | seg[p]
    else:
        res = (res | seg[p]) | seg[q]
    return res

#####単位元######
ide_ele = set()

#num:n以上の最小の2のべき乗
num =2**(n-1).bit_length()
seg=[ide_ele]*2*num

init(s)
#print(seg)

for i in range(q):
    t, x, y = map(str, sys.stdin.readline().split())
    if t == '2':
        l = int(x)-1
        r = int(y)-1
        print(len(query(l, r+1)))
    else:
        i = int(x)-1
        c = {ord(y)-ord('a')}
        update(i, c)
### BUGGY CODE ###

n,m = map(int,input().split())
diff = abs(n-m)
count1 = 1
count2 = 1
a = 1

def saiki(n):
    if n<=1:
        return 1
    return n * saiki(n-1)
if diff >= 2:
    print(0)
elif diff == 1:
    for i in range(1,max(n,m)+1):
        count1 *= i
    '''
    for i in range(1,(min(n,m)+1)):
        count2 *= i
    '''

    print(count1*(count1//max(n,m))%(10**9+7))
else:
    for i in range(1,n+1):
        count1 *= i
    print(count1*count1*2%(10**9+7))


### FIXED CODE ###

import math
n,m = map(int,input().split())
diff = abs(n-m)
count1 = 1
count2 = 1
a = 1

if diff >= 2:
    print(0)
elif diff == 1:
    ans = math.factorial(max(n,m))
    print(ans*(ans//max(n,m))%(10**9+7))
else:
    ans = math.factorial(n)
    print(ans*ans*2%(10**9+7))
### BUGGY CODE ###

import sys


def input():
    return sys.stdin.readline().strip()


def main():
    size, jumps = map(int, input().split())
    array = list(map(int, input().split()))
    dp = [999999999] * size
    dp[0] = 0
    # dp[1] = abs(array[0]- array[1])
    for i in range(size):
        for j in range(i + 1, 1 + i + jumps):
            if j < size:
                dp[j] = min(dp[j], dp[i] + abs(array[i] - array[j]))
    print(dp[size - 1])


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys


def input():
    return sys.stdin.readline().strip()


def main():
    size, jumps = map(int, input().split())
    array = list(map(int, input().split()))
    dp = [999999999] * size
    dp[0]= 0
    dp[1] = abs(array[0]- array[1])
    for i in range(2,size):
        dp[i] = min(abs(array[i] - array[j]) + dp[j] for j in range(max(0, i - jumps), i))
    print(dp[size-1])

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

from bisect import bisect_left, bisect_right

N = int(input())
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()
C.sort()

result = 0

for i in range(N):
    a = bisect_left(A,B[i])
    c = bisect_right(C,B[i])
    result += len(A[:a]) * len(C[c:])

print(result)



### FIXED CODE ###

from bisect import bisect_left, bisect_right

N = int(input())
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()
C.sort()

result = 0

for i in B:
    a = bisect_left(A,i)
    c = bisect_right(C,i)
    result += a * (N - c)

print(result)
### BUGGY CODE ###

n = int(input())
s = input()
ans = s[1:].count('E')
for i in range(1,len(s)-1):
    if s[i]==s[i-1]:
        continue
    ans = min(ans,s[:i].count('W')+s[i+1:].count('E'))
ans = min(ans,s[:len(s)].count('W'))
print(ans)

### FIXED CODE ###

n = int(input())
s = input()
w = [0]
e = [0]
for i in range(len(s)):
    if s[i]=="W":
        w.append(w[i]+1)
        e.append(e[i])
    else:
        w.append(w[i])
        e.append(e[i]+1)
ans = 10**9
for i in range(0,len(s)):
    ans = min(ans,w[i]+e[-1]-e[i+1])
print(ans)
### BUGGY CODE ###

n, k, q = map(int, input().split())
a = sorted([0] + list(int(input()) for _ in range(q)))
p = [0]

for i in range(1, n + 1):
    p.append(a.count(i))
    
for j in range(1, n + 1):
    if k - (q - p[j]) > 0:
        print('Yes')
    else:
        print('No')   

### FIXED CODE ###

n, k, q = map(int, input().split())
a = [0] + list(int(input()) for _ in range(q))
p = [k - q] * (n + 1)

for i in range(1, q + 1):
    p[a[i]] += 1
    
for j in range(1, n + 1):
    if p[j] > 0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

n, k = [int(x) for x in input().split()]

a_list = [int(x) for x in input().split()]
a_list.sort()

temp_list = [1] * (n + 1)
for i in range(1, n + 1):
    temp_list[i] = i * temp_list[i - 1]

mod = 10 ** 9 + 7
y = k - 2

ans = 0
for i in range(n - k + 1):
    for j in range(i + k - 1, n):
        f = a_list[j] - a_list[i]

        x = j - i - 1
        num = temp_list[x] // temp_list[y] // temp_list[x - y]

        ans += (f * num) % mod

ans %= mod
print(ans)

### FIXED CODE ###

n, k = [int(x) for x in input().split()]

a_list = [int(x) for x in input().split()]
a_list.sort()

mod = 10 ** 9 + 7

temp_list = [1] * (n + 1)
for i in range(1, n + 1):
    temp_list[i] = i * temp_list[i - 1] % mod

i_temp_list = [1] * (n + 1)
i_temp_list[-1] = pow(temp_list[-1], mod - 2, mod)
for i in range(n, 0, -1):
    i_temp_list[i - 1] = i_temp_list[i] * i % mod

y = k - 1

ans = 0
for i in range(k - 1, n):
        x = i
        num = temp_list[x] * i_temp_list[y] * i_temp_list[x - y] % mod
        ans += a_list[i] * num % mod
for i in range(n - k + 1):
        x = n - 1 - i
        num = temp_list[x] * i_temp_list[y] * i_temp_list[x - y] % mod
        ans -= a_list[i] * num % mod

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

# -*- coding: utf-8 -*-
import sys
import heapq

H,W=map(int,raw_input().split())

#隣接リスト
c=[[] for i in range(10)]
for i in range(10):
	a=map(int,raw_input().split())
	for j in range(10):
		c[i].append(a[j])

#print c

A=[]
for i in range(H):
	A.append(map(int, raw_input().split()))
#print A


def djk(n):
	#開始位置
	Start=n

	#初期化
	d=[-1 for i in range(10)]
	d[Start]=0


	#優先度付きキューに[距離,頂点の番号]を格納する
	#スタート地点の頂点1には距離0を入れる
	q=[]
	heapq.heappush(q, [0,Start])

	while len(q)!=0:
		#距離が最小の頂点を取り出し
		l,u=heapq.heappop(q)
		for i,val in enumerate(c[u]):
			v=i
			l_u_v=val
			#print v, l_u_v
			if (d[v]>d[u]+l_u_v) or d[v]==-1:
				d[v]=d[u]+l_u_v
				heapq.heappush(q, [d[v],v])
	return d[1]


sum=0
for i in range(H):
	for j in range(W):
		if A[i][j]==-1 or A[i][j]==1:
			continue
		else:
			sum+=djk(A[i][j])

print sum


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import heapq

H,W=map(int,raw_input().split())

#隣接リスト
c=[[] for i in range(10)]
for i in range(10):
	a=map(int,raw_input().split())
	for j in range(10):
		c[i].append(a[j])

#print c

A=[]
for i in range(H):
	A.append(map(int, raw_input().split()))
#print A


def djk(n):
	#開始位置
	Start=n

	#初期化
	d=[-1 for i in range(10)]
	d[Start]=0


	#優先度付きキューに[距離,頂点の番号]を格納する
	#スタート地点の頂点1には距離0を入れる
	q=[]
	heapq.heappush(q, [0,Start])

	while len(q)!=0:
		#距離が最小の頂点を取り出し
		l,u=heapq.heappop(q)
		for i,val in enumerate(c[u]):
			v=i
			l_u_v=val
			#print v, l_u_v
			if (d[v]>d[u]+l_u_v) or d[v]==-1:
				d[v]=d[u]+l_u_v
				heapq.heappush(q, [d[v],v])
	return d[1]


sum=0
temp=[0 for i in range(10)]
for i in range(H):
	for j in range(W):
		if A[i][j]==-1 or A[i][j]==1:
			continue
		else:
			if temp[A[i][j]]==0:
				temp[A[i][j]]=djk(A[i][j])
			sum+=temp[A[i][j]]

print sum
### BUGGY CODE ###

def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = [list(map(int, input().rstrip('\n').split())) for _ in range(n)]
    ls = [0] * n
    mt = [0] * n
    cnt = 0
    bbb = 0

    for i in range(n):
        if ls[i] != -1:
            mt[i] = a[i][ls[i]]

    for w in range(10 ** 15):
        cnt += 1
        bb = False
        update = []
        f = [False] * n
        for i in range(n):
            if not f[i]:
                if ls[i] != -1:
                    if i + 1 == mt[mt[i]-1]:
                        bb = True
                        f[i] = True
                        f[mt[i]-1] = True
                        if ls[i] + 1 < n - 1:
                            ls[i] += 1
                            update.append(i)
                        else:
                            ls[i] = -1
                            bbb += 1

                        if ls[mt[i]-1] + 1 < n - 1:
                            ls[mt[i]-1] += 1
                            update.append(mt[i]-1)
                        else:
                            ls[mt[i]-1] = -1
                            bbb += 1
        for i in update:
            if ls[i] != -1:
                mt[i] = a[i][ls[i]]
        if bbb == n:
            print(cnt)
            exit()
        if not bb:
            print(-1)
            exit()


if __name__ == '__main__':
    slove()


### FIXED CODE ###

def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = [list(map(int, input().rstrip('\n').split())) for _ in range(n)]
    ad = [0] * n
    dq = collections.deque([[0, i + 1] for i in range(n)])
    for i in range(10 ** 15):
        fd = {}
        while True:
            if len(dq) != 0:
                d, q = dq.popleft()
                q -= 1
                if d <= i:
                    if ad[q] < n - 1:
                        qq = a[q][ad[q]] - 1
                        tq = a[qq][ad[qq]] - 1
                        if q == tq and qq not in fd and tq not in fd:
                            ad[qq] += 1
                            ad[tq] += 1
                            if ad[qq] < n - 1:
                                dq.append([d + 1, qq + 1])
                            if ad[tq] < n - 1:
                                dq.append([d + 1, tq + 1])
                            fd[qq] = 0
                            fd[tq] = 0
                else:
                    dq.append([d, q + 1])
                    break
            else:
                break
        if len(dq) == 0:
            b = True
            for v in ad:
                if v != n - 1:
                    b = False
                    break
            if b:
                print(i + 1)
                exit()
            else:
                print(-1)
                exit()


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

A=list(map(int,input().split()))
t=True
C=2019
if t:
    for i in range(A[1]):
        for t in range(A[1]+1):
            if t>i and i>=A[0]:
                if t*i%2019<C:
                        C=t*i%2019
                        if C==0:
                            t=False 
                            break
print(C)

### FIXED CODE ###

l,r=list(map(int,input().split()))
f=True
C=2019
if (r-l)<2019:
    for i in range(l,r+1):
        if C==0:
            break
        for t in range(i+1,r+1):
            if t*i%2019<C:
                C=t*i%2019
                if C==0:
                    break
else:
    C=0
print(C)
### BUGGY CODE ###

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

import math
def combi(n,r):
    return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
from bisect import bisect_left

max_combi = 0
for i in range(1,n):
    idx = bisect_left(a[:i], (a[i]+1)//2)
    if a[idx] > (a[i]+1)//2:
        idx -= 1
    c = combi(a[i], a[idx])
    if c > max_combi:
        max_combi = c
        x,y = a[i], a[idx]

print(x,y)

### FIXED CODE ###

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

import bisect

mid = (a[-1]+1)//2
mid_idx = bisect.bisect_left(a, mid)

if abs(mid - a[mid_idx-1]) <= abs(a[mid_idx] - mid):
    print(a[-1], a[mid_idx-1])
else:
    print(a[-1], a[mid_idx])
### BUGGY CODE ###

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k=int(input())
ans=0
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            ans+=gcd(a,b,c)
print(ans)


### FIXED CODE ###

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k=int(input())
ans=0
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            ans+=gcd(a,b,c)
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
s = [0]*n

for i in range(max(a)):
	s[i] = a.count(i+1)
	
for i in range(n):
  	print(s[i])

### FIXED CODE ###

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

c = [0]*n
for i in a:
	c[i-1] += 1

for i in range(n):
	print(c[i])
### BUGGY CODE ###

S = input()

MOD=(10**9) + 7
N=13

dp=[0]*N
dp[0] = 1

mul = 1
for c in S[::-1]:
    next_dp=[0]*N
    
    for i in range(N):
        if c=='?':
            for j in range(10):
                ii = (i + (int(j)*mul)) % N
                next_dp[ii] += dp[i]
                next_dp[ii] = next_dp[ii] % MOD
        else:
            ii = (i + (int(c)*mul)) % N
            next_dp[ii] += dp[i]
            next_dp[ii] = next_dp[ii] % MOD

    mul *= 10
    dp = next_dp

print(dp[5])

### FIXED CODE ###

S = input()

MOD=(10**9) + 7
N=13

dp=[[0 for i in range(N)] for j in range(100005)]
dp[0][0] = 1

dpi = 1
mul = 1

for c in S[::-1]:    
    for i in range(N):
        if c=='?':
            for j in range(10):
                ii = (i + (j*mul)) % N
                dp[dpi][ii] += dp[dpi-1][i] % MOD
                #pass
        else:
            j = int(c)
            ii = (i + (j*mul)) % N
            dp[dpi][ii] += dp[dpi-1][i] % MOD
            #pass
    mul *= 10
    mul %= N
    dpi += 1

print(dp[dpi-1][5] % MOD)
### BUGGY CODE ###

N = int(input())
sum = 0
while(N > 0):
    sum += N%10
    sum %= 9
    N //= 10
if(sum==0):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N = int(input())
result = sum(list(map(int, str(N))))
if(result%9==0):
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
    b.append(i+1)
ans = [a.index(x)+1 for x in b]
print(' '.join(map(str,ans)))

### 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
print(' '.join(map(str,b)))
### BUGGY CODE ###

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

k_idx = K - 1
term_val_arr = []
for i in range(N - K + 1):
    val = 1
    for j in range(K):
        val *= a_arr[k_idx - j]
    term_val_arr.append(val)
    k_idx += 1

for i in range(N-K):
    if len(term_val_arr)-1 != i:
        if term_val_arr[i] < term_val_arr[i+1]:
            print('Yes')
        else:
            print('No')

### FIXED CODE ###

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

k_idx = K - 1
ans_arr = []
for i in range(N - K):
    if a_arr[i] < a_arr[k_idx + 1]:
        ans_arr.append('Yes')
    else:
        ans_arr.append('No')
    k_idx += 1
for i in ans_arr:
    print(i)
### BUGGY CODE ###

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

x=0

for i in range(m):
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)




### FIXED CODE ###

import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(1,N):
  for j in range(N-i):
    if A[j+i]+A[j]==i:
      #print(j,j+i,i)
      ans+=1
print(ans)

### FIXED CODE ###

from collections import defaultdict
di=defaultdict(int)
dj=defaultdict(int)
N=int(input())
A=list(map(int,input().split()))
for i,a in enumerate(A):
    di[i+a]+=1
    dj[i-a]+=1
X=set(di.keys())&set(dj.keys())
ans=0
for x in X:
    ans+=di[x]*dj[x]
print(ans)