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

import sys
input = sys.stdin.readline
 
#input
N = int(input())
A = list(map(int, input().split()))

from collections import Counter
import numpy as np
 
l = Counter(A).most_common()
l = [b for a, b in l]
l = np.array(l)

maximum_operation = [0] * N
for K in range(len(l)):
    l = Counter(A).most_common()
    l = [b for a, b in l]
    l = np.array(l)
    while l[K] > 0:
        l[0:K+1] -= 1
        l = np.sort(l, kind = "quicksort")[::-1]
        maximum_operation[K] += 1
 
for m in maximum_operation:
    print(m)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

#output
from collections import Counter
import bisect

l = Counter(A).most_common()
l = [b for a, b in l]
M = len(l)
l.sort()
p = sum(l)

maximum_operation = [0] * N

ll = []
for x in reversed(range(1, N+1)):
    a = bisect.bisect_left(l, x)
    if a == 0:
        b = M*x
        c = 0
    elif a >= M:
        b = 0
        c = p
    else:
        b = (M-a)*x
        c = sum(l[0:a]) 
    ll.append((b + c)/x)

for K in range(M):
    maximum_operation[K] = N - bisect.bisect_left(ll, K+1)

for m in maximum_operation:
    print(m)
### BUGGY CODE ###

import numpy as np
MOD = 1000000007
s = [int(x) if x!="?" else -1 for x in input()]
#s = s[::-1]
dp = np.full((len(s), 13), 0, dtype="int64")

if s[0] == -1:
    dp[0][0:10] = 1
else:
    dp[0][int(s[0])] = 1

table = [ s % 13 for s in range(130)]
for index in range(1, len(s)):
    if not s[index] == -1:
        value = int(s[index])

        for old_amari in range(13):
            new_amari = (table[old_amari * 10] + value) % 13
            dp[index][new_amari] += dp[index-1][old_amari]
    else:
        for value in range(10):
            for old_amari in range(13):
                new_amari = (table[old_amari * 10] + value) % 13
                dp[index][new_amari] += dp[index - 1][old_amari]

    dp[index] = dp[index] % MOD

print(dp[len(s)-1][5])

### FIXED CODE ###

MOD = 1000000007
s = [int(x) if x!="?" else -1 for x in input()]
dp = [[0] *  13 for _ in range(len(s))] 

if s[0] == -1:
    for i in range(10):
        dp[0][i] = 1
else:
    dp[0][int(s[0])] = 1
 
table = [ s % 13 for s in range(130)]
for index in range(1, len(s)):
    if not s[index] == -1:
        value = int(s[index])
 
        for old_amari in range(13):
            new_amari = (table[old_amari * 10] + value) % 13
            dp[index][new_amari] += dp[index-1][old_amari]
    else:
        for value in range(10):
            for old_amari in range(13):
                new_amari = (table[old_amari * 10] + value) % 13
                dp[index][new_amari] += dp[index - 1][old_amari]
 
    for i in range(len(dp[index])):
        dp[index][i] %= MOD

print(dp[len(s)-1][5])
### BUGGY CODE ###

# D

from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

N,A,B = map(int,input().split())
if (N == 2):
    print(0)
else:
    print((2**N - 1 - combinations_count(N, A) - combinations_count(N, B)) % (10**9+7))

### FIXED CODE ###

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

N,A,B = map(int,input().split())
if (N == 2):
    print(0)
else:
    print((2**N - 1 - combination(N, A) - combination(N, B)) % (10**9+7))
### BUGGY CODE ###

n=int(input())
a=[int(input()) for x in range(n)]
c=[0]*n

m=1
c[0]=a[0]

for i in range(1,n):
  f=0
  for j in range(m):
    if c[j]<a[i]:
      f=1
      c[j]=a[i]
      break
  if f==0:
    c[m]=a[i]
    m+=1

print(m)

### FIXED CODE ###

import bisect

N=int(input())
A=[-int(input()) for i in range(N)]

B=[]
c=0
for a in A:
  p=bisect.bisect_right(B,a)
  if p==c:
    B.append(a)
    c += 1
  else:
    B[p]=a

print(len(B))
### BUGGY CODE ###

n=int(input())

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

count=0

while all(x%2==0 for x in a):
    x=[x/2 for x in a]
    count+=1

print(count)

### FIXED CODE ###

input()
A=list(map(int,input().split()))
count=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count+=1
print(count)
### BUGGY CODE ###

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

BC = []
for _ in range(M):
    b, c = map(int, input().split())
    BC.append((b, c))
    
cards = A[:]
cards  =sorted(cards)

opes = BC[:]
opes = sorted(opes, reverse=True, key=lambda x: x[1])

#print(cards)
#print(opes)

top_list = []
for b, c in opes:
    top_list += [c] * b
top_list += [0] * N
    
#print(cards)
#print(top_list)

ans = 0
for i, (x, y) in enumerate(zip(cards, top_list[:N])):
    if x < y:
        ans += y
    else:
        ans += sum(cards[i:])
        break

print(ans)
    

            


### FIXED CODE ###

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

BC = []
for _ in range(M):
    b, c = map(int, input().split())
    BC.append((b, c))
    
cards = A[:]
opes = BC[:]

cards_dict = {}

for c in cards:
    if c in cards_dict:
        cards_dict[c] += 1
    else:
        cards_dict[c] = 1

for b, c in opes:
    if c in cards_dict:
        cards_dict[c] += b
    else:
        cards_dict[c] = b
        
cards_dict = sorted(cards_dict.items(), reverse=True)
#print(cards_dict)

num = 0
ans = 0
for k, v in cards_dict:
    if num + v > N:
        ans += k * (N-num)
        num = N
    else:
        ans +=  k * v
        num += v
    if num == N:
        break
        
print(ans)
### BUGGY CODE ###

s = input()
gx, gy = map(int, input().split())

from collections import deque
q = deque([[-1, 0, 0, (1, 0)]])

ans = 'No'
while q:
    i, x, y, rot = q.popleft()

    if i == len(s)-1 and x==gx and y == gy:
        ans = 'Yes'
        break
    elif i == len(s)-1:
        continue
    
    ind = s[i+1]

    if ind == 'F':
        q.append((i+1, x+rot[0], y+rot[1], rot))
    else:
        q.append((i+1, x, y, (-rot[1], rot[0])))
        q.append((i+1, x, y, (rot[1], -rot[0])))
print(ans)


### FIXED CODE ###

S = input()
gx, gy = map(int, input().split())
SL = S.split('T')
D = [len(sli) for sli in SL]
DX = D[2::2]
DY = D[1::2]

def reachable(D, s, g):
    dp = [{} for _ in range(len(D)+1)]
    dp[0][s] = 1
    for i in range(len(D)):
        d = D[i]
        for j in dp[i]:
            dp[i+1][j+d] = 1
            dp[i+1][j-d] = 1
    return g in dp[-1]

if reachable(DX, D[0], gx) and reachable(DY, 0, gy):
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

N = int(input())
H = list(map(int, input().split()))
sorted_H = sorted(H)
sorted_H.reverse()
ans = []
for h in sorted_H:
  cnt = 0
  flag = True
  now = H.index(h)
  while flag and (now + 1) < len(H):
    if H[now] < H[now + 1]:
      flag = False
    else:
      now += 1
      cnt += 1
  ans.append(cnt)
print(max(ans))

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
ans = []
cnt = 0

for i in range(N - 1):
  if H[i] < H[i + 1]:
    ans.append(cnt)
    cnt = 0
  else:
    cnt += 1
ans.append(cnt)
print(max(ans))
### BUGGY CODE ###

a = input()

ans = 1

for i in range(len(a)):
    for j in range(i, len(a)):
        if a[j:i:-1] + a[i] != a[i:j + 1] and a[i] != a[j]:
            ans += 1

print(ans)

### FIXED CODE ###

a = input()
total = 1 + (len(a) * (len(a) - 1) // 2)
trash = 0

for i in range(97, 97 + 26):
    atoz = (a.count(chr(i)) * (a.count(chr(i)) - 1)) // 2
    trash += atoz

print(total - trash)
### BUGGY CODE ###

n=input()

d=[]
for x in xrange(n):
    cmd, st = map(str, raw_input().split())
    
    if cmd == "insert":
        d.append(st)
    elif cmd == "find":
        print 'yes' if st in d else 'no'

### FIXED CODE ###

n=input()

d=set()
for x in xrange(n):
    cmd, st = map(str, raw_input().split())
    
    if cmd == "insert":
        d.add(st)
    elif cmd == "find":
        print 'yes' if st in d else 'no'
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans = ans * a[i]

if ans <= 10**18:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 1
if a.count(0):
    print(0)
    exit()

for i in range(n):
    ans = ans * a[i]
    if ans > 10**18:
        print(-1)
        exit()

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

import copy

T = input()
copy_T = copy.copy(T)
ans, ans_T = 0, ''

def do_T():
    global ans_T, T
    if '?' in T:
        tmp = T.index('?')
        T = change_T(T, tmp, 'P')
        do_T()
        T = change_T(T, tmp, 'D')
        do_T()
    else:
        var = count_T()
        if len(var) > 0:
            ans_T = var

def change_T(s, index, char):
    var = list(s)
    var[index] = char
    return ''.join(var)

def count_T():
    global ans, T
    var = T.count('PD') + T.count('D')
    if ans < var: 
        ans = max(ans, var)
        return T
    else: return ''


do_T()
print(ans_T)

### FIXED CODE ###

T = input()
print(T.replace('?', 'D'))
### BUGGY CODE ###

n, m = map(int, input().split())
a = sorted([int(i) for i in input().split()])
l = []
for _ in range(m):
    b, c = map(int, input().split())
    l += [c] * b
l = sorted(l, reverse=True)
i = 0
ans = 0
for p, q in zip(a, l):
    ans += max(p, q)
    i += 1
print(ans + sum(a[i:]))

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
a = sorted([int(i) for i in input().split()])
heapq.heapify(a)
l = []

for _ in range(m):
    b, c = map(int, input().split())
    l.append((b, c))

l = sorted(l, key=lambda x: x[1], reverse=True)

for b, c in l:
    if a[0] >= c:
        break
    for _ in range(b):
        if a[0] < c:
            heapq.heappushpop(a, c)
        else:
            break

print(sum(a))
### BUGGY CODE ###

N, K = map(int, input().split())
L = list(map(int, input().split()))
S = []
for i, x in enumerate(L):
  for y in L[i+1:]:
    S.append(x*y)
print(sorted(S)[K-1])

### FIXED CODE ###

import numpy as np
N, K = map(int, input().split())
L = np.array(list(map(int, input().split())))

L = np.sort(L)
pos = L[0<L]
neg = L[0>L]
zero = len(L[L==0])

def f(x):
  tmp = 0
  if x>=0:
    tmp += zero*N
  tmp += np.searchsorted(L, x//pos, side='right').sum()
  tmp += (N - np.searchsorted(L, -(-x//neg), side='left')).sum()
  tmp -= np.count_nonzero(L*L<=x)
  return tmp//2

l, r = -10**18, 10**18
while l<r-1:
  m = (l+r)//2
  count = f(m)
  if count >= K:
    r = m
  else:
    l = m

print(r)
### BUGGY CODE ###

s=input()
ans=0
while s.count('ABC')>0:
    ans+=s.count('ABC')
    s=s.replace('ABC','BCA')
print(ans)

### FIXED CODE ###

import re
s=input()
ss=s.replace('BC','D')
sss=re.split('[BC]',ss)
ans=0
for i in sss:
    acnt=0
    for g in i:
        if g=='A':
            acnt+=1
        else:
            ans+=acnt
print(ans)
### BUGGY CODE ###

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

mx = [0] * N
cnts = [0] * N
for i in range(N):
  if mx[i] == 0:
    nxt = P[i]-1
    tmp = 0
    l = [nxt]
    for j in range(N):
      tmp += C[nxt]
      nxt = P[nxt]-1
      l.append(nxt)
      if nxt == i:
        tmp += C[nxt]
        cnt = j+2
        break
    for k in l:
      cnts[k] = cnt
      n = ((K//cnt)-1) * tmp
      if tmp > 0:
        mx[k] += n
    
for i in range(N):
  nxt = P[i]-1
  tmp = 0
  m = min(C) - 1
  for j in range((K%cnts[i])+cnts[i]):
    tmp += C[nxt]
    m = max(m, tmp)
    nxt = P[nxt]-1
  mx[i] += m

ans = max(mx)
print(ans)

### FIXED CODE ###

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

mx = [0] * N
cnts = [0] * N
for i in range(N):
  if mx[i] == 0:
    nxt = P[i]-1
    tmp = 0
    l = [nxt]
    for j in range(N):
      tmp += C[nxt]
      nxt = P[nxt]-1
      l.append(nxt)
      if nxt == i:
        tmp += C[nxt]
        cnt = j+2
        break
    for k in l:
      cnts[k] = cnt
      n = ((K//cnt)-1) * tmp
      if tmp > 0:
        mx[k] += n
    
for i in range(N):
  nxt = P[i]-1
  tmp = 0
  m = min(C) - 1
  for j in range((K%cnts[i])+cnts[i]):
    tmp += C[nxt]
    m = max(m, tmp)
    nxt = P[nxt]-1
  mx[i] += m

ans = max(mx)
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 0
ans += a[0]
for i in range(1,n):
  ans = ans * a[i]
  if(ans > 10**18):
    ans = -1
    exit
print(ans)

### FIXED CODE ###

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

for i in A:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit()

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

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

bridges = []
for i in range(m):
    bridges.append([int(x) for x in input().split()])
'''
g = list(range(n+1))
ng = [1 for _ in range(n+1)]
gl = [[i] for i in range(n+1)]
ans = []
unconf = n*(n-1)//2
ans.append(unconf)


for x in reversed(bridges):
    a,b = x
    if g[a] != g[b]:
        tmp = ng[g[a]] * ng[g[b]]
        ng[g[a]] = ng[g[a]]+ng[g[b]]
        gl[g[a]] = gl[g[a]] + gl[g[b]]
        for y in gl[g[b]]:
            g[y] = g[a]
        unconf -= tmp
        ans.append(unconf)
    else:
        ans.append(unconf)


ans.reverse()
ans.pop(0)
for x in ans:
    print(x)
'''
def root(par, ifpar, a):
    while ifpar[a] != 1:
       a = par[a]
    return a 

def unite(par, ifpar, ra,rb):
    par[rb] = ra
    ifpar[rb] = 0


par = list(range(n+1))
ifpar = [1 for _ in range(n+1)]
npar = [1 for _ in range(n+1)]

ans = []
unconf = n*(n-1)//2
ans.append(unconf)

for x in reversed(bridges):
    a,b = x
    ra = root(par, ifpar, a)
    rb = root(par, ifpar, b)
    if ra != rb:
        tmp = npar[ra] * npar[rb]
        npar[ra] = npar[ra] + npar[rb]
        unite(par, ifpar, ra, rb)
        unconf -= tmp
    ans.append(unconf)

ans.reverse()
ans.pop(0)
for x in ans:
    print(x)

### FIXED CODE ###

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

bridges = []
for i in range(m):
    bridges.append([int(x) for x in input().split()])
'''
g = list(range(n+1))
ng = [1 for _ in range(n+1)]
gl = [[i] for i in range(n+1)]
ans = []
unconf = n*(n-1)//2
ans.append(unconf)


for x in reversed(bridges):
    a,b = x
    if g[a] != g[b]:
        tmp = ng[g[a]] * ng[g[b]]
        ng[g[a]] = ng[g[a]]+ng[g[b]]
        gl[g[a]] = gl[g[a]] + gl[g[b]]
        for y in gl[g[b]]:
            g[y] = g[a]
        unconf -= tmp
        ans.append(unconf)
    else:
        ans.append(unconf)


ans.reverse()
ans.pop(0)
for x in ans:
    print(x)
'''
def root(par, ifpar, a):
    while ifpar[a] != 1:
       a = par[a]
    return a 

def unite(cnt, par, ifpar, npar, depth, ra, rb):
    if depth[ra] >= depth[rb]:
        npar[ra] = npar[ra] + npar[rb]
        par[rb] = ra
        ifpar[rb] = 0
        if depth[ra] == depth[rb]:
            depth[ra] += 1
    else:
        npar[rb] = npar[rb] + npar[ra]
        par[ra] = rb
        ifpar[ra] = 0

par = list(range(n+1))
ifpar = [1 for _ in range(n+1)]
npar = [1 for _ in range(n+1)]
depth = [1 for _ in range(n+1)]

ans = []
unconf = n*(n-1)//2
ans.append(unconf)
cnt = 0

for x in reversed(bridges):
    a,b = x
    ra = root(par, ifpar, a)
    rb = root(par, ifpar, b)
    if ra != rb:
        tmp = npar[ra] * npar[rb]
        unite(cnt, par, ifpar, npar, depth, ra, rb)
        unconf -= tmp
    ans.append(unconf)
    cnt += 1

ans.reverse()
ans.pop(0)
for x in ans:
    print(x)
### BUGGY CODE ###

S = input()
N = len(S)
INF = float('inf')
dp = [INF] * N
dp[0] = 0
dp2 = {}
dp2[0] = 0
bits = [1 << i for i in range(26)]
x = 0

for i in range(N):
    x = x ^ bits[ord(S[i]) - ord('a')]
    tmp = INF
    if x not in dp2:
        dp2[x] = INF
    tmp = min(tmp, dp2[x])

    for b in bits:
        k = x ^ b
        if k not in dp2:
            dp2[k] = INF
        tmp = min(tmp, dp2[k])

    dp2[x] = min(dp2[x], tmp + 1)
    dp[i] = tmp + 1

print(dp[N - 1])

### FIXED CODE ###

S = input()
N = len(S)
INF = float('inf')
dp = [INF] * N
dp[0] = 0
dp2 = {}
dp2[0] = 0
bits = [1 << i for i in range(26)]
x = 0

for i in range(N):
    x = x ^ bits[ord(S[i]) - ord('a')]
    tmp = INF
    if x not in dp2:
        dp2[x] = INF
    tmp = min(tmp, dp2[x])

    for b in bits:
        k = x ^ b
        if k not in dp2:
            dp2[k] = INF
        tmp = min(tmp, dp2[k])

    dp2[x] = min(dp2[x], tmp + 1)
    dp[i] = tmp + 1

print(dp[N - 1])
### BUGGY CODE ###

N,M=map(int,input().split())
Xs=list(map(int,input().split()))


Xs.sort()
costs=[abs(Xs[i]-Xs[i+1]) for i in range(M-1)]


for i in range(N-1):
    if not costs:
        print(0)
        exit(0)
    costs.remove(max(costs))




print(sum(costs))

### FIXED CODE ###

N,M=map(int,input().split())
Xs=list(map(int,input().split()))


Xs.sort()
costs=[abs(Xs[i]-Xs[i+1]) for i in range(M-1)]
costs.sort(reverse=True)

for i in range(N-1):
    if not costs:
        print(0)
        exit(0)
    costs.pop(0)




print(sum(costs))
### BUGGY CODE ###

num = int(input())
line = [int(a) for a in input().split()]

for i in range(num):
    if line[i] in line[i+1:]:
        print('NO')
        break
else:
    print('YES')

### FIXED CODE ###

num = int(input())
line = [int(a) for a in input().split()]
set_line = list(set(line))

if len(line) == len(set_line):
    print('YES')
else:
    print('NO')
### BUGGY CODE ###

import array

n, m = map(int, input().split())
a = sorted(list(map(int, input().split())))
a = array.array("L", a)
for i in range(m):
    a[-1] //= 2
    for j in range(1, n):
        if a[-j] > a[-j - 1]:
            break
        a[-j], a[-j - 1] = a[-j - 1], a[-j]
print(sum(a))

### FIXED CODE ###

class heap():
    def __init__(self, maxcom=True):
        if maxcom:
            self.compare = lambda x, y: x > y
        else:
            self.compare = lambda x, y: x < y

    def heappush(self, x, heap):
        heap.append(x)
        length = len(heap)
        pointer = length
        while True:
            if pointer == 1:
                break
            if self.compare(heap[pointer - 1], heap[(pointer >> 1) - 1]):
                heap[pointer - 1], heap[(pointer >> 1) - 1] = heap[(pointer >> 1) - 1], heap[pointer - 1]
                pointer = pointer >> 1
            else:
                break

    def heapreplace(self, function, heap):
        heap[0] = function(heap[0])
        pointer = 1
        length = len(heap)
        while True:
            if (pointer << 1) > length:
                break
            elif (pointer << 1) + 1 > length :
                if self.compare(heap[(pointer << 1) - 1], heap[pointer - 1]):
                    heap[(pointer << 1) - 1], heap[pointer - 1] = heap[pointer - 1], heap[(pointer << 1) - 1]
                else:
                    break
            else:
                if self.compare(heap[(pointer << 1) - 1], heap[pointer << 1]):
                    next_pointer = pointer << 1
                else:
                    next_pointer = (pointer << 1) + 1
                if self.compare(heap[next_pointer - 1], heap[pointer - 1]):
                    heap[next_pointer - 1], heap[pointer - 1] = heap[pointer - 1], heap[next_pointer - 1]
                    pointer=next_pointer
                else:
                    break


n, m = map(int, input().split())
a = map(int, input().split())
heapq = []
heapc=heap(True)
for i in a:
    heapc.heappush(i,heapq)
for _ in range(m):
    heapc.heapreplace(lambda x:x>>1,heapq)
print(sum(heapq))
### BUGGY CODE ###

def z_arr(s):
    """An advanced computation of Z-values of a string."""
    # From https://ivanyu.me/blog/2013/10/15/z-algorithm/
 
    Z = [0] * len(s)
    Z[0] = len(s)
 
    rt = 0
    lt = 0
 
    for k in range(1, len(s)):
        if k > rt:
            # If k is outside the current Z-box, do naive computation.
            n = 0
            while n + k < len(s) and s[n] == s[n+k]:
                n += 1
            Z[k] = n
            if n > 0:
                lt = k
                rt = k+n-1
        else:
            # If k is inside the current Z-box, consider two cases.
 
            p = k - lt  # Pair index.
            right_part_len = rt - k + 1
 
            if Z[p] < right_part_len:
                Z[k] = Z[p]
            else:
                i = rt + 1
                while i < len(s) and s[i] == s[i - k]:
                    i += 1
                Z[k] = i - k
 
                lt = k
                rt = i - 1
    return Z
 
if __name__=="__main__":
    n=int(input())
    s=input()
    ans=0
    for i in range(len(s)):
        A=z_arr(s[i:])
        for a in range(len(A)):
            if A[a]<=a:
                ans=max(ans, A[a])
    print(ans)

### FIXED CODE ###

N = int(input())
S = input()
 
 
r = 1
ans = 0
for l in range(N):
 
    while True:
        #print(S.rfind(S[l:r+1]), S[l:r+1], l, r)
 
        if S.rfind(S[l:r+1]) >= r+1:
            r += 1
            ans = max(ans, r-l)
        else:
            break
 
print(ans)
### BUGGY CODE ###

n=list(map(int,input().split()))
men=list([n[1]]*n[0])
for i in range(n[2]):
    men=[j-1 for j in men]
    men[int(input())-1]+=1
y = ["Yes" if i > 0 else "No" for i in men]
print('\n'.join(map(str, y)))

### FIXED CODE ###

n=list(map(int,input().split()))
men=list([n[1]-n[2]]*n[0])
a=[int(input())-1 for i in range(n[2])]
for i in a:
    men[i]+=1
y = ["Yes" if i > 0 else "No" for i in men]
print('\n'.join(map(str, y)))
### BUGGY CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, q = na()
s = input()
index = [i for i in range(len(s)) if s[i:i+2]=="AC"]
for i in range(q):
    l, r = na()
    print(len([i for i in index if l - 1 <= i <= r - 1 and l - 1 <= i + 1 <= r - 1]))

### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, q = na()
s = input()
ct = [0] * n
for i in range(n-1):
    if s[i:i+2] == 'AC':
        ct[i+1] = 1
for i in range(n-1):
    ct[i+1] += ct[i]
for i in range(q):
    l, r = na()
    l -= 1
    r -= 1
    print(ct[r] - ct[l])
### BUGGY CODE ###

N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) for i in range(M)] 
d = {}
for i in sorted(PY, key=lambda x: x[1]):
    if i[0] in d:
        d[i[0]].append(i[1])
    else:
        d[i[0]] = [i[1]]
for i in PY:
    print(str(i[0]).zfill(6) + str(d[i[0]].index(i[1]) + 1).zfill(6))

### FIXED CODE ###

N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) + [i, 0] for i in range(M)] 
d = {}
for i in sorted(PY, key=lambda x: x[1]):
    if i[0] in d:
        d[i[0]] += 1
    else:
        d[i[0]] = 1
    i[3] = d[i[0]]
for i in PY:
    print(str(i[0]).zfill(6) + str(i[3]).zfill(6))
### BUGGY CODE ###

N = int(input())

#1st query
print(0)
sex = input()
memo = N-1
crnt = 0
clockwise = True
while True:
	if clockwise:
		next = crnt + (memo-crnt)//2
	else:
		next = crnt - (crnt - memo)//2
	pirnt(next)
	S = input()
	if S != sex:
		clockwise *= -1
		sex = S
		memo = crnt
	crnt = next


### FIXED CODE ###

import sys
N = int(input())
print(0, flush=True)
cond = input()
if cond == 'Vacant':
    sys.exit()

l = 0
r = N-1
while r-l > 3:
    mid = (l+r)//2
    if mid % 2 == 1:
        mid += 1

    print(mid, flush=True)
    I = input()
    if I == 'Vacant':
        sys.exit()
    else:
        if cond == I:
            l = mid
        else:
            r = mid

for i in range(l,r+1):
    print(i, flush=True)
    if input() == 'Vacant':
        sys.exit()