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

from math import gcd
    
k = int(input())
l1 = range(1, k+1)
s = 0

for a in l1:
    for b in l1:
        for c in l1:
            l2 = [a, b, c]
            g1 = gcd(a,b)
            g2 = gcd(g1, c)
            s += g2
print(s)

### FIXED CODE ###

from math import gcd

k = int(input())
range(1, k+1)

l1 = range(1, k+1)
def loop(s):
    for a in l1:
        for b in l1:
            for c in l1:
                l2 = (a, b, c)
                g1 = gcd(a,b)
                g2 = gcd(g1, c)
                s += g2
    return s

print(loop(0))
### BUGGY CODE ###


from fractions import gcd
from functools import reduce

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

ans = 0
for i in range(N):
 B = A[:]
 B.pop(i)
 ans = max(ans, reduce(gcd, B))

print(ans)

### FIXED CODE ###

# 参考1: https://atcoder.jp/contests/abc125/submissions/8965716
# 参考2: https://qiita.com/hkrutknouch/items/e71488de4a0c8e83ee97

from fractions import gcd
from itertools import accumulate

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

left = list(accumulate(A, gcd))
right = list(accumulate(A[::-1], gcd))[::-1]

ans = 0
for i in range(n):
  if i == 0:
    tmp = right[1]
  elif i == n - 1:
    tmp = left[-2]
  else:
    tmp = gcd(left[i-1], right[i+1])
  ans = max(ans, tmp)

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

N = int(input())
A = list(map(int, input().split()))
ans = 0
t = 0
u = 0
for i in range(60):
    if max(A) >= 2**i:
        u += 1
    else: break
for i in range(u):
    for j in range(N):
        if A[j] >= 2 ** i:
            t += ((A[j]%(2**(i+1)))//(2**i))
    ans += (t * (N-t)) * 2**i
    t = 0
print(ans%1000000007) 

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 0
t = 0
u = 0
m = max(A)
for i in range(60):
    if m >= 2**i:
        u += 1
    else: break
for i in range(u):
    for j in range(N):
        t += (A[j] >> i) & 1
    ans += (t * (N-t)) * 2**i
    t = 0
print(ans%1000000007)
### BUGGY CODE ###

n,q = map(int,input().split())
s = input()
ans = 0
for _ in range(q):
    l,r = map(int, input().split())
    tmp = s[l-1:r]
    ans = tmp.count('AC')
    print(ans)

### FIXED CODE ###

n, q = map(int, input().split())
S = 'X' + input()
T = [0]*(n+1)
for i in range(n):
    s = S[i:i+2]
    if s == 'AC':
        T[i+1] = T[i] + 1
    else:
        T[i+1] = T[i]
for _ in range(q):
    l,r = map(int, input().split())
    print(T[r]-T[l])
### BUGGY CODE ###

n = int(input())

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

dic = {}
lis = []
for i in a:
    if i in dic:
        dic[i] = dic[i] + 1
    else:
        dic[i] = 1
        lis.append(i)

lis.sort()
lis.reverse()

ans = 0
n -= 1
for i in lis:
    if max(lis) == i:
        k = 2 * dic[i] - 1
    else:
        k = 2 * dic[i]
    if n - k >= 0:
        ans += i * k
    else:
        ans += i * n
        break
    n -= k

print(ans)

### FIXED CODE ###

n = int(input())

a = list(map(int,input().split()))
a.sort()
ans = 0

for i in range(1,n):
    k = n - i // 2 - 1
    ans += a[k]

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

from decimal import *
n = int(input())
T = 45
F = 19
a = [[0 for i in range(F)] for j in range(T)]
p = pow(10,9)
two_size = 18
five_size = 18
count = 0
for i in range(n):
    k = Decimal(input()) * p
    two = 0
    five = 0
    while k % 2 == 0:
        two += 1
        k //= 2
    while k % 5 == 0:
        five += 1
        k //= 5
    t, f = two_size - two, five_size - five
    for x in range(t, T):
        for y in range(f, F):
            count += a[x][y]
    a[two][five] += 1
print(count)

### FIXED CODE ###


n = int(input())
T = 45
F = 19
a = [[0 for i in range(F)] for j in range(T)]
p = pow(10,9)
two_size = 18
five_size = 18
count = 0
for i in range(n):
    s = input()
    if '.' in s:
        index = s.index('.')
        s += '0' * (  9 - (len(s) - 1 - index))
        s = s.replace('.','')
    else :
        s += '0' * 9
    k = int(s)
    two = 0
    five = 0
    while k % 2 == 0:
        two += 1
        k //= 2
    while k % 5 == 0:
        five += 1
        k //= 5
    t, f = two_size - two, five_size - five
    for x in range(t, T):
        for y in range(f, F):
            count += a[x][y]
    a[two][five] += 1
print(count)
### BUGGY CODE ###

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

ans = -1
for i in range(2**n):
    cnt = 0
    for j in range(n):
        if i >> j & 1:
            cnt += a[j]
    if cnt % 10 == 0:
        cnt = 0
    ans= max(ans, cnt)
print(ans)

### FIXED CODE ###

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

ans = sum(a)
if ans % 10 != 0:
    print(ans)
    exit()
    
flg = False
for i in range(n):
    if a[i] % 10 != 0:
        ans -= a[i]
        flg = True
        break
print(ans) if flg else print(0)
### BUGGY CODE ###

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

dp = [float("inf")]*N
dp[0] = 0
dp[1] = abs(H[1]-H[0])

for i in range(2, N):
    for j in range(1, K+1):
        if i >= j:
            dp[i] = min(dp[i], dp[i-j] + abs(H[i-j] - H[i]))

print(dp[N-1])



### FIXED CODE ###

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

dp = [float("inf")]*N
dp[0] = 0
dp[1] = abs(H[1]-H[0])

for i in range(2, N):
    for j in range(1, K+1):
        if i >= j:
            dp[i] = min(dp[i], dp[i-j] + abs(H[i-j] - H[i]))

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

n,k=map(int,input().split())
p=list(map(int,input().split()))
ans=0
c=0
for i in range(n-k+1):
    if sum(p[i:i+k])>=c:
        c=sum(p[i:i+k])
        ans=c/2+0.5*k
        #print(c,ans)
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[p[0]]
for i in range(1,n):
    s.append(s[-1]+p[i])
ans=0
c=0
for i in range(n-k):
    if c<=s[i+k]-s[i]:
        c=s[i+k]-s[i]
#print(s)
if n!=k:
    print((c+k)/2)
else:
    print((s[-1])/2+0.5*k)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
for i in range(m):
  b,c = input().split()
  for j in range(int(b)):
    if a[j] < int(c):
      a[j] = int(c)
    else:
      break
  a.sort()
print(sum(a))

### FIXED CODE ###

from operator import itemgetter
n,m = map(int,input().split())
*a,= map(int,input().split())
l = [tuple(map(int,input().split()))for _ in range(m)]
a.sort()
l.sort(key = itemgetter(1), reverse = True)
cmp = []
cnt = 0
for b,c in l:
	cmp += [c]*b
	cnt += b
	if cnt >= n:
		cnt = n
		break
cut = cnt
for i,(x,y) in enumerate(zip(a,cmp[:min(n,cnt+1)])):
	if x > y:
		cut = i
		break
print(sum(cmp[:cut] + a[cut:]))
### BUGGY CODE ###

def gcd(*A):
    A = set(A)
    tmp = min(A)
    B = {ai % tmp for ai in A if ai % tmp > 0}
    B.add(tmp)
    for _ in range(100000000000000):
        A = B
        tmp = min(A)
        B = {ai % tmp for ai in A if ai % tmp > 0}
        if len(B) == 0: break 
        B.add(tmp)
    return tmp    


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

print(max(gcd(*(A[j] for j in range(N) if i != j)) for i in range(N)))

### FIXED CODE ###

def gcd(a, b):
    tmp = a % b
    while tmp != 0:
        a, b = b, tmp
        tmp = a % b
    return b

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

L = [0 for _ in range(N)]
R = [0 for _ in range(N)]

L[0], R[N - 1] = A[0], A[N - 1]

for i in range(N-1): # i=0,1,...N-2
    L[i + 1] = gcd(L[i], A[i + 1])
    R[N - i - 2] = gcd(R[N - i - 1], A[N - i - 2])

print(max(L[N-2], R[1], *(gcd(L[i], R[i+2]) for i in range(N-2))))
### BUGGY CODE ###

import numpy as np
from bisect import bisect_left

N,M = 2,4
s = [[2,55],[2,77],[2,33],[1,44]]
Ps = np.array(s)

N, M = map(int,input().split())
Ps = np.zeros((M,2))
for i in range(M):
    j, Y = map(int,input().split())
    Ps[i] = [j,Y]

dist = []
for i in range(N):
    s = Ps[np.where(Ps[:,0]==i+1)][:,1]
    dist.append(np.sort(s))

for city, year in Ps:
    city = int(city)
    rank = bisect_left(dist[city-1],year)
    print("{:06d}{:06d}".format(city,rank+1))

### FIXED CODE ###

from collections import defaultdict
from bisect import bisect_left
N, M = map(int, input().split())
A = []
B = defaultdict(list)
 
for i in range(M):
    p, y = map(int, input().split())
    A.append([p, y])
    B[p].append(y)
 
for key in B.keys():
    B[key].sort()

# print(A,B)
# for a in A:
#     print(a[0],a[1],B[a[0]],bisect_left(B[a[0]],a[1]))
for a in A:
    print("%06d%06d" % (a[0], bisect_left(B[a[0]], a[1])+1))
### BUGGY CODE ###

mem = {}
def gcd(a, b):
    global mem
    if (a, b) not in mem:
        mem[(a, b)] = a if b == 0 else gcd(b, a%b)
    return mem[(a, b)]

K = int(input())
res = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            res += gcd(gcd(i, j), k)
print(res)

### FIXED CODE ###

from math import gcd
K = int(input())
res = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            res += gcd(gcd(i, j), k)
print(res)
### BUGGY CODE ###

from collections import Counter
n = int(input())
s = input()
m = 10000000000000000
for i in range(0, n):
    a = s[:i]
    b = s[i+1:]
    cnt = Counter(a)['W'] + Counter(b)['E']
    m = min(m, cnt)

print(m)


### FIXED CODE ###

n = int(input())
s = input()
m = n

w = [s[0].count('W')]
e = [s[0].count('E')]

for i in range(1, n):
    if s[i] == 'W':
        w.append(w[i-1]+1)
        e.append(e[i-1])
    else:
        w.append(w[i-1])
        e.append(e[i-1]+1) 

for i in range(n):
    if i > 0:
        cnt = w[i-1] + e[-1] - e[i]
    else:
        cnt = e[-1] - e[0]
    m = min(cnt, m)
print(m)
### BUGGY CODE ###

from collections import defaultdict
H, W, M = map(int, input().split())
rows = {i: 0 for i in range(H)}
cols = {i: 0 for i in range(W)}
d = defaultdict(int)
for _ in range(M):
    h, w = map(int, input().split())
    h -= 1
    w -= 1
    rows[h] += 1
    cols[w] += 1
    d[(h,w)] += 1
max_rows = [kv for kv in rows.items() if kv[1] == max(rows.values())]
max_cols = [kv for kv in cols.items() if kv[1] == max(cols.values())]
non_dup = False
ans = max_rows[0][1] + max_cols[0][1]
flg = False
for kh, vh in max_rows:
    for kw, vw in max_cols:
        if d[(kh, kw)] == 0:
            non_dup = True
            flg = True
            break
    if flg:
        break
if not non_dup:
    ans -= 1
print(ans)

### FIXED CODE ###

from collections import defaultdict
H, W, M = map(int, input().split())
rows = {i: 0 for i in range(H)}
cols = {i: 0 for i in range(W)}
d = defaultdict(int)
for _ in range(M):
    h, w = map(int, input().split())
    h -= 1
    w -= 1
    rows[h] += 1
    cols[w] += 1
    d[(h,w)] += 1
mr = max(rows.values())
mc = max(cols.values())
max_rows = [kv for kv in rows.items() if kv[1] == mr]
max_cols = [kv for kv in cols.items() if kv[1] == mc]
non_dup = False
ans = max_rows[0][1] + max_cols[0][1]
flg = False
for kh, vh in max_rows:
    for kw, vw in max_cols:
        if d[(kh, kw)] == 0:
            non_dup = True
            flg = True
            break
    if flg:
        break
if not non_dup:
    ans -= 1
print(ans)
### BUGGY CODE ###

import math

H, W, N = map(int, input().split())
count = [0]*10
count[0] = (H-2)*(W-2)
rectmap=[]

#print(board)
for i in range(0,N):
    a, b = list(map(int, input().split()))
    for j in range(a-1, a+2):
        for k in range(b-1, b+2):
            if j>1 and j<H and k>1 and k<W:
                rectmap.append([j-1, k-1])
#    print(rectmap)
rectmap.sort()
while rectmap!=[] :
#    print(rectmap[0])
#    print(rectmap)
    count[rectmap.count(rectmap[0])]+=1
    count[0]-=1
    del rectmap[:rectmap.count(rectmap[0])]
for i in range(0, 10):
    print(count[i])    
#print(H,W,N)
#print(ab)


### FIXED CODE ###

import math

H, W, N = map(int, input().split())
count = [0]*10
count[0] = (H-2)*(W-2)
rectmap={}

#print(board)
for i in range(0,N):
    a, b = input().split()
    a = int(a)
    b = int(b)
    ab = (a, b)
    al = max(a-1, 2)
    au = min(a+2, H)
    bl = max(b-1, 2)
    bu = min(b+2, W)

    for j in range(al, au):
        for k in range(bl, bu):
            if (j,k) in rectmap:
                rectmap[(j,k)] +=1
            else:
                rectmap[(j,k)] = 1
#            print(rectmap)
##    for j in range(a-1, a+2):
##        for k in range(b-1, b+2):
##            if j>1 and j<H and k>1 and k<W:
##                rectmap.append([j-1, k-1])
#print(rectmap)
for i in rectmap.values():
    count[i]+=1
    count[0]-=1
for c in count:
    print(c)
#print(H,W,N)
#print(ab)
### BUGGY CODE ###


def canProd(i,m):
    
    if m == 0:
        return True
    if i >= n:
        return False

    res = canProd(i+1,m) or canProd(i+1,m-a[i])
    return res


n = int(input())
a = [int(x) for x in input().split()]
q = int(input())
m = [int(x) for x in input().split()]

tf = [False]*2001

for i in range(min(m),max(m)+1):
    if canProd(0,i):
        tf[i] = True



for i in m:
    if tf[i]:
        print("yes")
    else:
        print("no")

### FIXED CODE ###

from functools import lru_cache

@lru_cache(maxsize = None)
def canProd(i,m):
     
    if m == 0:
        return True
    if i >= n:
        return False
 
    res = canProd(i+1,m) or canProd(i+1,m-a[i])
    return res
 
 
n = int(input())
a = [int(x) for x in input().split()]
q = int(input())
m = [int(x) for x in input().split()]

rs = [None]*2001

maxm = max(m)
minm = min(m)

for i in range(minm,maxm+1):
    if canProd(0,i):
        rs[i] = "yes"
    else:
        rs[i] = "no"

for i in m:
    print(rs[i])
### BUGGY CODE ###

k, s = list(map(int, input().split()))
ct = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x + y + z == s:
                ct += 1
print(ct)

### FIXED CODE ###

k, s = list(map(int, input().split()))
ct = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if 0 <= z <= k:
            ct += 1
print(ct)
### BUGGY CODE ###

import sys
from collections import deque

def resolve():
    input=sys.stdin.readline
    N,Q=map(int,input().rstrip().split())
    S=list(input().rstrip())
    R=[list(map(int,input().rstrip().split())) for _ in range(Q)]
    cumsum=[0 for i in range(N)]

    _S=deque(S)
    T=""
    for i in range(N):
        #T=S[0:i+1]#i=0で一字含む, 
        T+=_S.popleft()
        cumsum[i]=T.count("AC")#cumsum[i]:i+1文字以下でACを含むか
    
    cumsum=[0]+cumsum#cumsum[i]:i文字以下でACを含むか
    for j in range(Q):
        print(cumsum[R[j][1]]-cumsum[R[j][0]])

from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """8 3
ACACTACG
3 7
2 3
1 8"""
        output = """2
0
3"""
        self.assertIO(input, output)

if __name__ == "__main__":
    #unittest.main()
    resolve()

### FIXED CODE ###

import sys
from collections import deque

def resolve():
    input=sys.stdin.readline
    N,Q=map(int,input().rstrip().split())
    S=list(input().rstrip())
    R=[list(map(int,input().rstrip().split())) for _ in range(Q)]
    cumsum=[0 for i in range(N)]

    _S=deque(S)
    prevT=_S.popleft()
    for i in range(1,N):
        #T=S[0:i+1]#i=0で一字含む, 
        """
        T+=_S.popleft()
        cumsum[i]=T.count("AC")#cumsum[i]:i+1文字以下でACを含むか
        """
        nowT=_S.popleft()
        if(prevT=="A" and nowT=="C"):
            cumsum[i]=cumsum[i-1]+1
        else:
            cumsum[i]=cumsum[i-1]
        prevT=nowT

    cumsum=[0]+cumsum#cumsum[i]:i文字以下でACを含むか
    for j in range(Q):
        print(cumsum[R[j][1]]-cumsum[R[j][0]])

from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """8 3
ACACTACG
3 7
2 3
1 8"""
        output = """2
0
3"""
        self.assertIO(input, output)

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

import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,u,v = map(int,ipt().split())
    way = [[] for _ in range(n+1)]
    for _ in range(n-1):
        a,b = map(int,ipt().split())
        way[a].append(b)
        way[b].append(a)

    t = 0
    tp = [-1]*(n+1)
    tp[v] = 0 #AOKI
    hqt = [(0,u)]
    hqa = [(0,v)]
    while hqt:
        f = False
        while hqt and hqt[0][0] == t:
            ti,pi = hpq.heappop(hqt)
            if tp[pi] == 0:
                continue
            for i in way[pi]:
                if tp[i] == -1:
                    f = True
                    hpq.heappush(hqt,(ti+1,i))
        while hqa and hqa[0][0] == t:
            ti,pi = hpq.heappop(hqa)
            for i in way[pi]:
                if tp[i] == -1:
                    tp[i] = 0
                    hpq.heappush(hqa,(ti+1,i))
        if f:
            t += 1
    print(t)

    return

if __name__ == '__main__':
    main()


### FIXED CODE ###

import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,u,v = map(int,ipt().split())
    way = [[] for _ in range(n+1)]
    for _ in range(n-1):
        a,b = map(int,ipt().split())
        way[a].append(b)
        way[b].append(a)

    ta = [-1]*(n+1)
    tt = [-1]*(n+1)
    ta[v] = 0 #AOKI
    tt[u] = 0
    qa = queue.Queue()
    qt = queue.Queue()
    qt.put((0,u,-1))
    qa.put((0,v,-1))

    while not qa.empty():
        ti,pi,pp = qa.get()
        for i in way[pi]:
            if i == pp:
                continue
            if ta[i] == -1:
                ta[i] = ti+1
                qa.put((ti+1,i,pi))

    while not qt.empty():
        ti,pi,pp = qt.get()
        if ta[pi] <= ti:
            continue
        for i in way[pi]:
            if i == pp:
                continue
            if ta[i] > ti:
                tt[i] = ti+1
                qt.put((ti+1,i,pi))

    ma = 0
    for i in range(1,n+1):
        if tt[i] == -1:
            continue
        if ma < tt[i]+max(0,ta[i]-tt[i]-1):
            ma = tt[i]+max(0,ta[i]-tt[i]-1)
    print(ma)


    return

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

N = int(input())

target_list = list(map(int, input().split()))
result = []

for i in range(int(input())):
    B, C = map(int, input().split())
    if B in target_list:
        num = target_list.count(B)
        target_list = [x for x in target_list if x != B]
        target_list.extend([C] * num)
        result.append(sum(target_list))
    else:
        result.append(sum(target_list))

for i in result:
    print(i)


### FIXED CODE ###

from collections import Counter

N = int(input())

target_list = list(map(int, input().split()))
check = Counter(target_list)
result = sum(target_list)


for index in range(int(input())):
    B, C = map(int, input().split())
    if B in check:
        result = result + (check[B]) * (C - B)
        if C in check:
            check[C] = check[C] + check[B]
        else:
            check[C] = check[B]
        check[B] = 0
    print(result)
### BUGGY CODE ###

def main():
    class rolling_hash():
        def __init__(self, seq):
            seq_size = len(seq)  # 文字列の長さ
            self.H0s = [0]*(seq_size+1)  # 先頭からi-1文字目までのハッシュ値
            H0s, p = self.H0s, 0
            for i, j in enumerate(seq):
                p = (p+(j+1)*pow(3, i, mod)) % mod
                H0s[i+1] = p

        def calc_hash(self, l, r):  # l文字目からr-1文字目までのハッシュ値
            H0s = self.H0s
            return ((H0s[r]-H0s[l])*pow(3, l*(mod-2), mod)) % mod

    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    mod = 2**61-1

    memo = [0]*n

    for k in range(32):
        a1 = [i % 2 for i in a]
        a1 += a1
        a2 = [i ^ 1 for i in a1]
        b_hash = rolling_hash([i % 2 for i in b]).calc_hash(0, n)
        a1 = rolling_hash(a1)
        a2 = rolling_hash(a2)
        for i, j in enumerate(memo):
            if j is None:
                continue
            elif a1.calc_hash(i, i+n) == b_hash:
                pass
            elif a2.calc_hash(i, i+n) == b_hash:
                memo[i] += 2**k
            else:
                memo[i] = None
        a = [i // 2 for i in a]
        b = [i // 2 for i in b]

    for i, j in enumerate(memo):
        if j is not None:
            print(i, j)


main()


### FIXED CODE ###

def main():
    mod = 2**31-1
    pow3 = [1]*200001
    p = 1
    i3 = pow(3, mod-2, mod)
    for i in range(1, 200001):
        p = p*3 % mod
        pow3[i] = p

    def rolling_hash(seq):
        h = 0
        for i, j in enumerate(seq):
            h += (j+1)*pow3[i]
        h %= mod
        H0s = [0]*n
        for i, j in enumerate(seq):
            H0s[i] = h
            h = (h-j-1+(j+1)*pn)*i3 % mod
        return H0s

    def rolling_hash2(seq):
        p = 0
        p2 = 0
        for i, j in enumerate(seq):
            p += (j+1)*pow3[i]
            p2 += (2-j)*pow3[i]
        return p % mod, p2 % mod

    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    m = max(a+b)
    a1 = [0]*n
    b1 = [0]*n
    memo = [0]*n
    cnt = n
    pn = pow3[n]

    for k in range(len(bin(m))-2):
        k2 = 2**k
        for i, j in enumerate(a):
            a1[i] = (j & k2) >> k
        for i, j in enumerate(b):
            b1[i] = (j & k2) >> k
        b_hash, b_hash2 = rolling_hash2(b1)
        A1 = rolling_hash(a1)
        for i, (j, k) in enumerate(zip(memo, A1)):
            if j is None:
                continue
            elif k == b_hash:
                pass
            elif k == b_hash2:
                memo[i] += k2
            else:
                memo[i] = None
                cnt -= 1
        if cnt == 0:
            return

    for i, j in enumerate(memo):
        if j is not None:
            print(i, j)


main()
### BUGGY CODE ###

N = int(input())
S = list(input())

ans = float('inf')

for i in range(N):
    cnt_w = S[:i].count('W')
    cnt_e = S[i:].count('E')
    temp = cnt_w + cnt_e
    ans = min(ans, temp)

print(ans)


### FIXED CODE ###

N = int(input())
S = input()

e = S.count('E')
w = 0
ans = e

for s in S:
    if s=='E':
        e -= 1
    elif s=='W':
        w += 1
    ew = e + w
    ans = min(ans, ew)

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

int_n, int_k = map(int, input().split())

ar_int = list()

for i in range(int_n):
    int_a, int_b = map(int, input().split())
    for x in range(int_b):
        ar_int.append(int_a)

print(sorted(ar_int)[int_k - 1])


### FIXED CODE ###

int_n, int_k = map(int, input().split())

li_wk = list()

for i in range(int_n):
    li_wk.append(list(map(int, input().split())))

li_wk.sort(key=lambda x: x[0])

counter = 1
for l in li_wk:
    if counter <= int_k <= (counter + l[1] - 1):
        print(l[0])
    counter += l[1]
### BUGGY CODE ###

n, k, q = map(int,input().split())
a=[]
for i in range(q):
    a.append(int(input()))

    
for i in range(n):
    if k-(q-a.count(i+1))>0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

import collections
n, k, q = map(int,input().split())
a=[]
for i in range(q):
    a.append(int(input()))

c = collections.Counter(a)

sa = k-q

for i in range(n):
    if sa+c[i+1]>0:
        print("Yes")
    else:
        print("No")