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

s=input()
c=0
for k in range(4,len(s)+1):
  for i in range(0,len(s)+1-k):
    if int(s[i:i+k])%2019==0:
      c+=1
print(c)

### FIXED CODE ###

s=input()
r=set()
last=0
power=1
d={0:0}
total=0
rem=0
for i in range(len(s)-1,-1,-1):#handling of 0's as n and rem
    n=int(s[i])*power+rem
    power*=10
    power=power%2019
    rem=n%2019
    if rem in d.keys():
        d[rem]+=1
    else:
        d[rem]=1
    total+=d[rem]-1
print(total+d[0])
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
B = sorted(A)
x = int()
y = int()
count = 0 
for i in range(len(B)):
  x = B[i]
  y = 0
  y += A.count(x)
  y += A.count(x+1)
  y += A.count(x-1)
  if count <= y:
    count = y
print(count)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = [0]*(10**6)
c = int()
ans = int(0)
for i in range(len(A)):
  B[A[i]] += 1

for i in range(1,len(B)-2):
  c = 0
  c += B[i-1]
  c += B[i]
  c += B[i+1]
  if ans <= c:
    ans = c
print(ans)
### BUGGY CODE ###

from math import factorial
N = int(input())
line = input()
l = []
counts = {}
for n in line.split(' '):
  n = int(n)
  if n not in counts:
    counts[n] = 0
  counts[n] += 1
  l.append(n)

results = {}

for n in counts:
  results[n] = 0
  for m in counts:
    count = counts[m]
    if m == n:
      count -= 1
    if count > 1:
      results[n] += int(factorial(count)) // 2 // int(factorial(count - 2))

for n in l:
  print(results[n])

### FIXED CODE ###

from math import factorial
N = int(input())
line = input()
l = []
counts = {}
for n in line.split(' '):
  n = int(n)
  if n not in counts:
    counts[n] = 0
  counts[n] += 1
  l.append(n)

comb = {}

for n in counts:
  comb[n] = 0
  count = counts[n]
  if count > 1:
    comb[n] += int(factorial(count)) // 2 // int(factorial(count - 2))

total = sum([comb[n] for n in comb])

for n in l:
  count = counts[n]
  result = total - comb[n]
  if count - 1 > 1:
    result += comb[n] * (count - 2) // count
  print(result)
### BUGGY CODE ###

n, q = map(int, input().split())
s = input()
lr = [map(int, input().split()) for _ in range(q)]
sub = [s[i:i + 2] == "AC" for i in range(len(s) - 1)]
acc = [sum(sub[:i]) for i in range(len(sub))] + [sum(sub)]
for l, r in lr:
  print(acc[r - 1] - acc[l - 1])

### FIXED CODE ###

n, q = map(int, input().split())
s = input()
ac = [0] * n
for i in range(n - 1):
  ac[i + 1] = ac[i] + int(s[i:i + 2] == "AC")
for i in range(q):
  l, r = [int(lr) - 1 for lr in input().split()]
  print(ac[r] - ac[l])
### BUGGY CODE ###

wfwfe=input()

b=input().split()

if "0" in b:
    print (0)
else:

    count=1
    for i in b:
        count=count*int(i)
        
    if count>10**18:
        print (-1)
    else:
        print (count)


### FIXED CODE ###

wfwfe=input()
check=0
b=input().split()
if "0" in b:
    print (0)
else:
    
    count=1
    for i in b:
        count=count*int(i)
        
        if count>10**18:
            print (-1)
            check=1
            break
    if check==0:
        print (count)
### BUGGY CODE ###

n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = [a_list.count(i) for i in range(n+1)]
b_list.sort(reverse = True)
print(n-sum(b_list[:k:]))

### FIXED CODE ###

import collections
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b = collections.Counter(a_list)
d = b.most_common()[k:]
sum = 0
for i in d:
    sum += i[1]
print(sum)
### BUGGY CODE ###

n,m = map(int, input().split())
A = sorted(list(map(int, input().split())),reverse=True)

def cnt(x):
    c = 0
    for j in range(len(A)):
        i = 0
        while i <n and A[j]+A[i]>=x:
            c += 1
            i += 1
    return c

def happiness(x):
    c = 0
    for j in range(len(A)):
        i = 0
        while i <n and A[j]+A[i]>=x:
            c += A[j]+A[i]
            i += 1
    return c

def binary_search(l, r):
    mid = (l+r)//2
    c = cnt(mid)
    if c < m:
        return binary_search(l, mid)   
    else:
        if l == mid:
            return(l, c-m)
        return binary_search(mid, r)

x, dm = binary_search(0, A[0]*2+1)
print(happiness(x)-dm*x)

### FIXED CODE ###

N, M = map(int, input().split())
A = sorted(list(map(int,input().split())), reverse=True)

# jとの組み合わせがx以上になるiの個数
def combinations(x):
  s = 0
  i = 0
  for j in reversed(range(N)):
    while i<N and A[i]+A[j]>=x:
      i += 1
    s += i
  return s
 
#↑のような組み合わせの合計幸福度
def koufukudo(x):
  s = 0
  si = 0
  i = 0
  for j in reversed(range(N)):
    while i<N and A[i]+A[j]>=x:
      si += A[i]
      i += 1
    s += si + A[j]*i  
  return s
 
#
def bsearch(l, u):
  m = (l+u)//2
  c = combinations(m)
#   print(f"m{m}, c{c},c-M{c-M}")
  if c<M:
    return bsearch(l, m)
  else:
    if l==m:
      return (l, c-M)
    return bsearch(m, u)
 
x, dm = bsearch(0, A[0]*2+1)
print(koufukudo(x)-dm*x)
### BUGGY CODE ###

s = list(input())
t = list(input())
pair = []
ans = "Yes"

def check(pair,i,s,t):
    for j in range(len(pair)):
        if s!=pair[j][0] and s!=pair[j][1] and t!=pair[j][0] and t!=pair[j][1]:
            pass
        elif s==pair[j][0] and t==pair[j][1]:
            pass
        elif s==pair[j][1] or t==pair[j][0]:
            pass
        else:
            return False
    return True

for i in range(len(s)):
    if check(pair,i,s[i],t[i]):
        pair.append([s[i],t[i]])
    else:
        ans = "No"
        break

print(ans)


### FIXED CODE ###

s = list(input())
t = list(input())
pair = []
li =[]
ans = "Yes"

for i in range(len(s)):
    if [s[i],t[i]] in li:
        pass
    else:
        li.append([s[i],t[i]])

def check2(pair,i,li):
    for j in range(len(pair)):
        if (li[i][0]==pair[j][0] and li[i][1]!=pair[j][1])or(li[i][0]!=pair[j][0] and li[i][1]==pair[j][1]):
            return False
    return True

for i in range(len(li)):
    if check2(pair,i,li):
        pair.append([li[i][0],li[i][1]])
    else:
        ans = "No"
        break

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

import numpy as np
from scipy.sparse.csgraph import dijkstra

@np.vectorize
def trans(s):
    return 1 if s == "#" else 0

H, W = map(int, input().split())
S = np.array([trans([w for w in input()]) for _ in range(H)]).flatten()

def next_point(i, j, H, W, S):
    if S[i] != S[j]:
        if i == j + 1 and i % W != 0:
            return 2
        elif i == j - 1 and j % W != 0:
            return 2
        elif i == j + W:
            return 2
        elif i == j - W:
            return 2
        else:
            return 1
    else:
        return 0

G = np.array([[next_point(i, j, H, W, S) for j in range(len(S))] for i in range(len(S))])
connections = dijkstra(G >= 2)
c = (connections < np.inf) * G >= 1
print(int(np.sum(c) / 2))

### FIXED CODE ###


import numpy as np
from collections import deque
import sys

def parse(inp):
    H, W = map(int, next(inp).split())
    return np.array([list(next(inp).strip()) for _ in range(H)])

dis = [0, 0, 1, -1]
djs = [1, -1, 0, 0]

def search(S, i, j, Q, R):
    H, W = S.shape
    R[i, j] = True
    Q.append((i, j))
    n0 = 0
    n1 = 0
    while Q:
        i, j = Q.popleft()
        if S[i, j] == "#":
            n1 += 1
        else:
            n0 += 1
        gen = ((i + di, j + dj) for di, dj in zip(dis, djs))
        ijs = (g for g in gen if 0 <= g[0] and g[0] < H and 0 <= g[1] and g[1] < W)
        for ni, nj in ijs:
            if not R[ni, nj] and S[ni, nj] != S[i, j]:
                R[ni, nj] = True
                Q.append((ni, nj))
    return n0 * n1


def test(S):
    i, j = 0, 0
    Q = deque()
    R = np.full(S.shape, False)
    H, W = S.shape
    n = 0
    for i in range(H):
        for j in range(W):
            if not R[i, j]:
                n += search(S, i, j, Q, R)
    return n

print(test(parse(sys.stdin)))
### BUGGY CODE ###

import numpy as np
H, W = map(int,input().split())
S = []
for i in range(H):
    s = str(input())
    S.append(np.array([s[i] for i in range(W)]))
S = np.array(S)
LR = np.array([np.array([-1 for i in range(W)]) for j in range(H)])
UD = np.array([np.array([-1 for i in range(W)]) for j in range(H)])
count = 0
for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            LR[h][w] = 0
            LR[h][w-count:w] = np.array([count for i in range(count)])
            count = 0
        else:
            count += 1
    if count != 0:
        LR[h][-count:] = np.array([count for i in range(count)])
        count = 0
UD = UD.T
S = S.T
for w in range(W):
    for h in range(H):
        if S[w][h] == '#':
            UD[w][h] = 0
            UD[w][h-count:h] = np.array([count for i in range(count)])
            count = 0
        else:
            count += 1
    if count != 0:
        UD[w][-count:] = np.array([count for i in range(count)])
        count = 0
UD = UD.T
S = S.T
al = UD + LR
print(np.max(al)-1)

### FIXED CODE ###

import numpy as np

H, W = map(int,input().split())
S = [list(input()) for _ in range(H)]
S = np.array(S)
S = (S == '.') * 1

R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)

for i in range(W):
    if i == 0:
        L[:, 0] = S[:, 0]
        R[:, W - 1] = S[:, W - 1]
    else:
        L[:, i] = L[:, i - 1] * S[:, i] + S[:, i]
        R[:, W - i - 1] = R[:, W - i] * S[:, W - i - 1] + S[:, W - i - 1]
for i in range(H):
    if i == 0:
        U[i] = S[i]
        D[H - 1] = S[H - 1]
    else:
        U[i] = U[i - 1] * S[i] + S[i]
        D[H - i - 1] = D[H - i] * S[H - i - 1] + S[H - i - 1]

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

mod = 998244353
n, s = map(int, input().split())
a = list(map(int, input().split()))
dp = [0] * (s + 1)
ans = 0
for i in range(n):
    dp[0] += 1
    for j in range(a[i], s + 1)[::-1]:
        dp[j] += dp[j - a[i]]
        dp[j] %= mod
    ans += dp[-1]
    ans %= mod
print(ans)

### FIXED CODE ###

mod = 998244353
n, s = map(int, input().split())
a = list(map(int, input().split()))
dp = [0] * (s + 1)
ans = 0
for i in range(n):
    dp[0] += 1
    for j in range(a[i], s + 1)[::-1]:
        dp[j] += dp[j - a[i]]
        dp[j] %= mod
    ans += dp[-1]
    ans %= mod
print(ans)
### BUGGY CODE ###

from collections import deque
N,M=map(int,input().strip().split())
A=list(map(int,input().strip().split()))
BC=[list(map(int,input().strip().split())) for _ in range(M)]
A.sort()
A=deque(A)
BC.sort(key=lambda x:x[1],reverse=True)

ans=0
fin=False
for m in range(M):
    if fin==True:
        break
    i=0
    while i<BC[m][0]:
        if A:
            if BC[m][1]>=A[0]:
                ans+=BC[m][1]
                A.popleft()
                i+=1
            else:
                ans+=sum(A)
                fin=True
                break
        else:
            fin=True
if fin==False and A:
    ans+=sum(A)
print(ans)

### FIXED CODE ###

from collections import deque
N,M=map(int,input().strip().split())
A=list(map(int,input().strip().split()))
BC=[list(map(int,input().strip().split())) for _ in range(M)]
A.sort()
A=deque(A)
BC.sort(key=lambda x:x[1],reverse=True)

ans=0
fin=False
for m in range(M):
    if fin==True:
        break
    i=0
    while i<BC[m][0]:
        if A:
            if BC[m][1]>=A[0]:
                ans+=BC[m][1]
                A.popleft()
                i+=1
            else:
                ans+=sum(A)
                fin=True
                break
        else:
            fin=True
            break
if fin==False and A:
    ans+=sum(A)
print(ans)
### BUGGY CODE ###

n,k=map(int,input().split())
c=0
s = k if k%2==1 else k//2
for i in range(s,n+1,s):
    for j in range(s,n+1,s):
        for l in range(s,n+1,s):
            if (i+j)%k==0 and (i+l)%k==0 and (j+l)%k==0:
                c+=1
print(c)


### FIXED CODE ###

n,k=map(int,input().split())
c=0
s = k if k%2==1 else k//2
for i in range(s,n+1,s):
    s2 = k if i%k==0 else s
    n2 = (n-s2)//k+1
    c+=n2**2
print(c)
### BUGGY CODE ###

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

b = []
r = 1

b.append(a[0])
for i in range(1, n):
    if(i%2 == 1):
        b.append(a[i])
        r = 0
    else:
        b.insert(0, a[i])
        r = 1

if(n % 2 == 0):
    b.reverse()
    

print(*b)


### FIXED CODE ###

from collections import *
n = int(input())
a = [int(i) for i in input().split()]

b = deque()

b.append(a[0])
for i in range(1, n):
    if(i%2 == 1):
        b.append(a[i])  
    else:
        b.appendleft(a[i])
   

if(n % 2 == 0):
    b.reverse()
    

print(' '.join(map(str, b)))
### BUGGY CODE ###

import bisect
import copy
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))




N=one_int()
L=many_int()

L=sorted(L)

sankaku_dict={}
search_end={}
for i in range(len(L)-1):
    low=L[i]
    Lcopy = copy.deepcopy(L)
    Lcopy.remove(low)
    
    for j in range(i+1, len(L)):
        #すでに探索済みか判定
        temp = str(L[i]) +","+ str(L[j])
        if temp in search_end:
            continue
        high = L[j]
        Lcopy2 = copy.deepcopy(Lcopy)
        Lcopy2.remove(high)
        
        high=L[j]
        #下限を取得    
        under_index = bisect.bisect_right(Lcopy2,high-low)
        #上限を取得
        high_index = bisect.bisect_left(Lcopy2,high+low)
        
        for va in Lcopy2[under_index:high_index]:
            temp = sorted([high,low, va])
            temp = (temp[0]*10**8) + (temp[1]*10**4) + temp[2]
            sankaku_dict[temp]=1

# len(sankaku_dict)
print(len(sankaku_dict.keys()))

### FIXED CODE ###

import bisect
import copy
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))


N=one_int()
L=many_int()

L=sorted(L)

sankaku_dict={}
count=0
for i in range(len(L)-1):
    low=L[i]
    for j in range(i+1, len(L)):
        #すでに探索済みか判定
        high = L[j]
        
        #上限を取得
        high_index = bisect.bisect_left(L[j+1:], high+low)
        count+=high_index#len(L[j+1:high_index])

# len(sankaku_dict)
print(count)
# print(len(sankaku_dict.keys()))
### BUGGY CODE ###

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

x_sort = sorted(x[:])

for i in range(n):
    x_sort_temp = x_sort[:]
    x_sort_temp.remove(x[i])
    #print("x_sort_removed",x_sort_temp)
    print(x_sort_temp[(n-1)//2])

### FIXED CODE ###

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

x_sort = sorted(x[:])
a,b = x_sort[n//2 - 1], x_sort[n//2]

for i in range(n):
    if x[i] <= a:
        print(b)
    else:
        print(a)
### BUGGY CODE ###

N = input()
As = list(map(int, input().split()))
ans = 1
inf = 10 ** 18
for a in As:
    ans *= a

if ans > inf:
    print(-1)
    exit()
print(ans)

### FIXED CODE ###

N = input()
As = list(map(int, input().split()))
for a in As:
    if a == 0:
        print(0)
        exit()
ans = 1
inf = 10 ** 18
for a in As:
    ans *= a
    if ans > inf:
        print(-1)
        exit()
print(ans)
### BUGGY CODE ###

a=raw_input().lower()
c=0
while 1:
	b=raw_input().lower()
	if b.strip()=='end_of_text':break
	pos=0
	while b.find(a,pos)!=-1:
		pos=b.find(a)+1
		c+=1
print c

### FIXED CODE ###


import sys

w=input()

print(sys.stdin.read().lower().split().count(w))
### BUGGY CODE ###

import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))

koubai = lcm_list(lst)
total = 0
for l in lst:
    b = koubai//l
    total += b
    total %= mod
print(total)

### FIXED CODE ###

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

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

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)
### BUGGY CODE ###

#!/usr/bin/env python3
#ABC122 C

n,q = map(int,input().split())
s = list(input())
t = ["0" for _ in range(n)]

for i in range(n):
    if i < n-1:
        if s[i] == 'A':
            if s[i+1] == 'C':
                t[i] = 'a'
ans = []
for _ in range(q):
    l,r = map(int,input().split())
    c = t[l-1:r-1].count("a")
    ans.append(c)
for i in range(q):
    print(ans[i])


### FIXED CODE ###

#!/usr/bin/env python3
#ABC122 C

n,q = map(int,input().split())
s = input()
t = [0 for _ in range(n+1)]

for i in range(n):
    t[i+1] = t[i] + (1 if s[i:i+2] =='AC' else 0)

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

count=int(raw_input())
l=[]
n=[]
for i in xrange(count):
	a,b=raw_input().split()
	if a=='insert':
		l.append(b)
	elif a=='find':
		if b in l:
			n.append('yes')
		else:
			n.append('no')

for i in n:
	print i

### FIXED CODE ###

count=int(raw_input())
l=set()
for i in xrange(count):
	a,b=raw_input().split()
	if a=='insert':
		l.add(b)
	elif b in l:
		print 'yes'
	else:
		print 'no'
### BUGGY CODE ###

N=int(input())
S=input()
key=set()
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            key.add(S[i]+S[j]+S[k])
print(len(key))

### FIXED CODE ###

N=int(input())
S=input()
count=0
for i in range(1000):
    p='0'*(3-len(str(i)))+str(i)
    p1=S.find(p[0])
    if p1!=-1:
        p2=S[p1+1:].find(p[1])
        if p2!=-1:
            p3=S[p1+p2+2:].find(p[2])
            if p3!=-1:
                count+=1
print(count)
### BUGGY CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()
A = sorted(inpl())

#nCr
def comb(n,r):
    x = 1
    y = 1
    for i in range(r):
        x = x*(n-i)%mod #コンビネーションの分子
        y = y*(i+1)%mod #コンビネーションの分母
    return (x * pow(y, mod-2, mod) % mod)

ncr = [0]*(n+1)
for i in range(1,n+1):
    ncr[i] = comb(n-i,k-1)

ans = 0
for i in range(n):
    c = comb(n-i-1,k-1)
    ans += A[n-1-i] * c - A[i] * c
    ans %= mod

print(ans)


### FIXED CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()
A = sorted(inpl())

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

#nCr
def comb(n,r):
    if n <= 0 or r <= 0:
        return 0
    x = f[n] % mod
    y = f[r] * f[n-r] % mod
    return (x * pow(y, mod-2, mod) % mod)

ans = 0
for i in range(n):
    c = comb(n-i-1,k-1)
    ans += A[n-1-i] * c - A[i] * c
    ans %= mod
    if c == 1:
        break

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

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

def intinp():
    return int(input())


N, M = mapint_inp()

adjm = [[0]*(N+1) for _ in range(N+1)]

for i in range(M):
    A, B = mapint_inp()
    adjm[A][B] = 1
    adjm[B][A] = 1

ans = [0]*(N+1)

from collections import deque

q = deque([1])
visited = set()
visited.add(1)
while q:
    now = q.popleft()
    for i, room in enumerate(adjm[now]):
        if room == 0: continue
        if i not in visited:
            q.append(i)
            visited.add(i)
            ans[i] = now

f = True
for i, e in enumerate(ans):
    if i == 0: continue
    if i == 1: continue
    if e == 0:
        f = False

if f:
    print("Yes")
    for i, e in enumerate(ans):
        if i == 0: continue
        if i == 1: continue
        print(e)
else:
    print("No")

### FIXED CODE ###

from collections import deque

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

def intinp():
    return int(input())


n, m = mapint_inp()
graph = [[] for _ in range(n)]
ans = [0]*n

for _ in range(m):
    a, b = mapint_inp()
    a -= 1; b -= 1
    graph[a].append(b)
    graph[b].append(a) 

q = deque([0])
visited = [False]*n
visited[0] = True
while q:
    now = q.popleft()
    for i in graph[now]:
        if visited[i]: continue
        visited[i] = True
        ans[i] = now
        q.append(i)

print("Yes")
for i in range(1, n):
    print(ans[i]+1)
### BUGGY CODE ###

import itertools

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

ans = ''
for v in itertools.permutations(A_list):
    counter = 0
    for i in range(len(v)-1):
        if (v[i]*v[i+1]) % 4 == 0:
            counter += 1
        else:
            break
    if counter + 1 == len(v):
        ans += 'Yes'
        print(ans)
        break
if ans == '':
    print('No')



### FIXED CODE ###

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

dic = {4: 0, 2: 0, 1: 0}
for i in A_list:
    if i % 4 == 0:
        dic[4] += 1
    elif i % 2 == 0:
        dic[2] += 1
    else:
        dic[1] += 1
dic[4] += dic[2] // 2

if len(A_list) // 2 <= dic[4]:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

A,B = input().split()
A,B = int(A),int(B)

lcm = 1
cms = []
for i in range(1,max([A,B])+1):
    if(A%i==0 and B%i==0):
        lcm = i
        cms.append(i)

d = 2
cms_dic = {}
cms = [1]
lcm_= lcm
while(lcm_>1):
    if(lcm_%d==0):
        lcm_ /= d
        if(str(d) in cms_dic.keys()):
            cms_dic[str(d)]+=1
        else:
            cms_dic[str(d)] = 1
            cms.append(d)
    else:
        d += 1
print(len(cms))

### FIXED CODE ###

import collections
A,B = input().split()
A,B = int(A),int(B)
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A = collections.Counter(prime_factorize(A)).keys()
B = collections.Counter(prime_factorize(B)).keys()


cms = []
for a in A:
    for b in B:
        if(a==b):
            cms.append(a)
print(len(cms)+1)
### BUGGY CODE ###

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

seisuu.sort()
seisuu.reverse()
for i in range(K, N):
    ans += seisuu[i]
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
seisuu = [0 for i in range(N+1)]
for i in range(N):
    seisuu[A[i]] += 1
        

seisuu.sort()
seisuu.reverse()
for i in range(K, N):
    ans += seisuu[i]
print(ans)