Problem:
 Score : 200 points    Problem Statement There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.  Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.   A Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B .  An overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B -th or above among all overseas students.   A string S is assigned indicating attributes of all participants. If the i -th character of string S is a , this means the participant ranked i -th in the Qualification contests is a Japanese student; b means the participant ranked i -th is an overseas student; and c means the participant ranked i -th is neither of these.  Write a program that outputs for all the participants in descending rank either Yes if they passed the Qualification contests or No if they did not pass.      Constraints  1≦N,A,B≦100000  A+B≦N  S is N characters long.  S consists only of the letters a , b and c .         Input Inputs are provided from Standard Input in the following form.  N  A  B  S       Output Output N lines. On the i -th line, output Yes if the i -th participant passed the Qualification contests or No if that participant did not pass.        Sample Input 1 10 2 3
abccabaabb      Sample Output 1 Yes
Yes
No
No
Yes
Yes
Yes
No
No
No  The first, second, fifth, sixth, and seventh participants pass the Qualification contests.       Sample Input 2 12 5 2
cabbabaacaba      Sample Output 2 No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No  The sixth participant is third among overseas students and thus does not pass the Qualification contests.       Sample Input 3 5 2 2
ccccc      Sample Output 3 No
No
No
No
No

Solution (Python):
N, A, B = map(int, input().split())
str = input()

K = 0
L = 0

for i in range(N):
  if(str[i] == "a"):
    if(K < A + B):
      print("Yes")
      K+=1
    else:
      print("No")
  elif(str[i] == "b"):
    if(K < A + B and L < B):
      print("Yes")
      K+=1
      L+=1
    else:
      print("No")
  else:
  	print("No")

Solution (Python):
n,a,b=map(int,input().split())
s=input()
cnt=0
cntfo=0
for i in range(n):
    if s[i]=="a":
        if cnt<a+b:
            print("Yes")
            cnt+=1
        else:
            print("No")
    elif s[i]=="b":
        if cnt<a+b and cntfo<b:
            print("Yes")
            cnt+=1
            cntfo+=1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
N, A, B = map(int, input().split())
S = input()

s1 = 0

s2 = 1


for x in range(N):
    if S[x] == "a":
        if s1 < A + B:
            print("Yes")
            s1 += 1
        else:
            print("No")

    elif S[x] == "b":
        if s1 < A + B and s2 <= B:
            print("Yes")
            s1 += 1
        else:
            print("No")
        s2 += 1

    elif S[x] == "c":
        print("No")

Solution (Python):
N,A,B = map(int,input().split())
S = input()

cnt = A + B

for i in range(N):
    if cnt == 0:
        print('No')
    elif cnt > 0 and B == 0 and S[i] == 'b':
        print('No')
    elif S[i] == 'a':
        print('Yes')
        cnt -= 1
    elif S[i] == 'b':
        print('Yes')
        cnt -= 1
        B -= 1
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()

ans = ["No"] * N
kaigai = 0
cnt = 0
for i in range(N):
    if S[i] == "a":
        if cnt < A + B:
            ans[i] = "Yes"
            cnt += 1

    elif S[i] == "b":
        if cnt < A+B and kaigai < B:
            ans[i] = "Yes"
            kaigai += 1
            cnt += 1

for i in ans:
    print(i)

Solution (Python):
N,A,B = map(int, input().split())
S = input()

for i in range(N):
  if S[i] == 'c':
    print('No')
  elif S[i] == 'a' and (A+B) > 0:
    print('Yes')
    A -= 1
  elif S[i] == 'b' and (A+B) > 0 and B > 0:
    print('Yes')
    B -= 1
  else:
    print('No')

Solution (Python):
N, A, B = map(int, input().split())
C = input()
D = [C[i:i+1] for i in range(N)]
AA = 0
BB = 0
for i in(D):
  if i == 'c':
    print('No')
  elif i =='a' and A+B > AA+BB:
    print('Yes')
    AA += 1
  elif i =='b' and A+B > AA+BB and BB < B:
    print('Yes')
    BB += 1
  else:
    print('No')

Solution (Python):
N,A,B=map(int,input().split())
S=str(input())
M=A+B
K=0
Foreign=0
for j in S:
  if j=="c":
    print("No")
  else:
    if j=="a":
      K+=1
      if K<=M:
        print("Yes")
      else:
        print("No")
    else:
      Foreign+=1
      if Foreign<=B:
        K+=1
        if K<=M:
          print("Yes")
        else:
          print("No")
      else:
        print("No")

Solution (Python):

import sys
import copy
from collections import deque


def main():

    n ,a, b = map(int, input().split())
    s=input()
    cnt=[0,0]
    for i ,item in enumerate(s):
        if item=='a' and a+b>cnt[0]:
            print('Yes')
            cnt[0]+=1

        elif item=='b' and a+b>cnt[0] and b>cnt[1] :
            print("Yes")
            cnt[0]+=1
            cnt[1]+=1
        else:
            print("No")


main()

Solution (Python):
import numpy as np
import sys

input = sys.stdin.readline

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

S = input()

nai = 0
gai = 0


goukaku = 0
for i in range(len(S)):
    if S[i] == 'a':
        nai+=1
        if goukaku < A+B:
            goukaku+=1
            print("Yes")
        else:
            print("No")

    elif S[i] == 'b':
        gai+=1
        if goukaku < A+B and gai <= B:
            goukaku+=1
            print("Yes")
        else:
            print("No")

    elif S[i] == 'c':
        print("No")

Solution (Python):
N,A,B = map(int,input().split())
S = input()

pass_human = 0
overseas = 0

for i in S:
    if i == "a":
        if pass_human < A+B:
            print("Yes")
            pass_human += 1
        else:
            print("No")
    elif i == "b":
        if pass_human < A+B and overseas < B:
            print("Yes")
            pass_human += 1
            overseas += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
N, A, B = map(int, input().split())
S = input()

count = 0
countb = 0
for i, v in enumerate(S):
    if (v == 'c'):
        print('No')
    elif(v == 'a'):
        if (count < A + B):
            print('Yes')
            count += 1
        else:
            print('No')
    elif (v == 'b'):
        countb += 1
        if (count < B + A and countb <= B):
            print('Yes')
            count += 1
        else:
            print('No')

Solution (Python):
n, a, b = map(int, input().split())
S = input()
cnt = 0
no = 0
for i in range(n):
    if S[i] == 'a':
        if cnt < a+b:
            print('Yes')
            cnt += 1
        else:
            print('No')
    if S[i] == 'b':
        no += 1
        if cnt < a+b and no <= b:
            print('Yes')
            cnt += 1
        else:
            print('No')
    if S[i] == 'c':
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()
a = 0
b = 0
for s in S:
    if s == "c":
        print("No")
    elif s == "a":
        if a < A + B:
            print("Yes")
            a += 1
        else:
            print("No")
    else:
        b += 1
        if a < A + B and b <= B:
            a += 1
            print("Yes")
        else:
            print("No")

Solution (Python):
n,a,b = map(int,raw_input().split())
s = raw_input()
apb = 0
over = 0
for i in s:
    if i =='a':
        if apb >= a+b:
            print  'No'
        else:
            print 'Yes'
            apb+=1
    elif i == 'b':
        if apb < a+b and over <=b-1:
            print 'Yes'
            apb+=1
            over+=1
        else:
            print 'No'
    else:
        print 'No'

Solution (Python):
p = 0
f = 0
n, a, b = map(int, input().split())
for i in input():
    if i == "a" and p < a+b:
        p += 1
        print("Yes")
    elif i == "b" and p < a+b and f < b:
        p += 1
        f += 1
        print("Yes")
    else:
        print("No")

Solution (Python):
p = f = 0
n, a, b = map(int, input().split())
q = print

for i in input():
    if i == "a" and p < a + b:
        p += 1
        q("Yes")

    elif i == "b" and p < a + b and f < b:
        p += 1
        f += 1
        q("Yes")
    
    else:
        q("No")

Solution (Python):

n,a,b = map(int,input().split())
s = input()
c = a+b
kaigai = []
yosen = []

for i in s:
    if i == 'a':
        if len(yosen) < c:
            print('Yes')
            yosen.append(i)
        else:
            print('No')
    elif i == 'b':
        if len(yosen) < c and len(kaigai) < b:
            print('Yes')
            yosen.append(i)
            kaigai.append(i)
        else:
            print('No')
            
        
    else:
        print('No')

Solution (Python):
N,a,b = map(int,input().split())
S = str(input())

C=[]
A=0
B=0

for i in range(len(S)):
    if S[i] == 'a':
        if A+B < a+b:
            A += 1
            C.append('Yes')
        else:
            C.append('No')

    elif S[i] == 'b':
        if A+B < a+b and B < b:
            B += 1
            C.append('Yes')
        else:
            C.append('No')
    else:
        C.append('No')

for w in C:
    print(w)

Solution (Python):
n, a, b = map(int, input().split())
s = input()
tukasha = 0
kaigai_tukasha = 0
for i in range(n):
    if s[i] == 'a' and tukasha < a + b:
        print('Yes')
        tukasha += 1
    elif s[i] == 'b' and tukasha < a + b and kaigai_tukasha < b:
        print('Yes')
        tukasha += 1
        kaigai_tukasha += 1
    else:
        print('No')

Solution (Python):
N,A,B = map(int,input().split())
S = list(input())

C = A + B
ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df <= C:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df <= C and f <= B:
      ans.append('Yes')
    else:
      df -= 1
      ans.append('No')
      
print('\n'.join(ans))

Solution (Python):
N,A,B = list(map(int,input().split()))
total = A+B
outsea = 0
passer = 0
for s in input():
    if s == "c":
        print('No')
        continue
    elif s == "a":
        if passer < total:
            passer += 1
            print('Yes')
        else:
            print('No')
    else:
        outsea += 1
        if passer < total and outsea <= B:
            passer += 1
            print('Yes')
        else:
            print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()

cnt = 0
cnt_b = 0
for s in S:
    if s =='a':
        if cnt < A+B:
            print('Yes')
            cnt+=1
        else:
            print('No')
    elif s=='b':
        if (cnt < A+B)&(cnt_b < B):
            print('Yes')
            cnt+=1
            cnt_b+=1
        else:
            print('No')
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()
T = []
Answer = []
Acount = 0
Tcount = 0

for i in range(N):
  if S[i] == "a":
    if A + B > Acount:
      Answer.append("Yes")
      Acount += 1
    else:
      Answer.append("No")
  elif S[i] == "b":
    if A + B > Acount and B > Tcount:
      Answer.append("Yes")
      T.append("Yes")
      Acount +=1
      Tcount +=1
    else:
      Answer.append("No")
  else:
    Answer.append("No")
  print(Answer[i])

Solution (Python):
n,a,b=map(int,input().split())
s=input()
c,d=0,0
for i in range(n):
  f=0
  if s[i]=="a":
    if c<a+b:
      f=1
      c+=1
  if s[i]=="b":
    if c<a+b and d<b:
      f=1
      c+=1
      d+=1
  print("Yes" if f==1 else "No")

Solution (Python):
N,A,B=map(int,input().split())
S=input()
student=0
abroad=0
for i in range(len(S)):
    if S[i]=='c':
        print('No')
    
    if S[i]=='a':
        if student<(A+B):
            print('Yes')
            student+=1
        else:
            print('No')
    
    if S[i]=='b':
        if student<(A+B) and abroad<B:
            print('Yes')
            student+=1
            abroad+=1
        else:
            print('No')

Solution (Python):
N, A, B = map(int, input().split())
s = input()

a = 0
b = 0
for si in s:
    if si == 'a' and a+b < A+B:
        a += 1
        print('Yes')
    elif si == 'b' and a+b < A+B and b < B:
        b += 1
        print('Yes')
    else:
        print('No')

Solution (Python):
li = list(map(int,input().split()))
s=list(input())
cnt = 0
b = 0
for i in s:
    if i == "a":
        if cnt < li[1] + li[2]:
            cnt += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        b += 1
        if cnt < li[1] + li[2]:
            if b <= li[2]:
                cnt += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        
        print("No")

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N, A, B = map(int, readline().split())
  S = input()
  L = len(S)
  cnt_AB = 0
  cnt_B = 0
  for i in range(L):
    s = S[i]
    if s == 'a':
      if cnt_AB < A + B:
        print('Yes')
        cnt_AB += 1
      else:
        print('No')
    elif s == 'b':
      if cnt_AB<A+B and cnt_B<B:
        print('Yes')
        cnt_AB += 1
        cnt_B += 1
      else:
        print('No')
    else:
      print('No')
  
  
  
if __name__ == '__main__':
  main()

Solution (Python):
li = list(map(int,input().split()))
s=list(input())
cnt = 0
b = 0
for i in s:
    if i == "a":
        if cnt < li[1] + li[2]:
            cnt += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        b += 1
        if cnt < li[1] + li[2]:
            if b <= li[2]:
                cnt += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        
        print("No")

Solution (Python):
n, a, b = map(int,input().split())
s_list = list(input())
judge=[]
count_tot = 0
count_inter = 0

for s in s_list:
    if s == 'a':
        if count_tot < a+b:
            judge.append('Yes')
            count_tot += 1
            continue
    elif s == 'b':
        if count_tot < a+b and count_inter < b:
            judge.append('Yes')
            count_tot += 1
            count_inter += 1
            continue
    judge.append('No')

for result in judge:
    print(result)

Solution (Python):
n, a, b = map(int, input().split())
s = input()

aac = 0
bac = 0

for i in s:
    if i == 'a' and aac + bac < a + b:
        print("Yes")
        aac += 1
    elif i == 'b' and aac + bac < a + b and bac < b:
        print("Yes")
        bac += 1
    else:
        print("No")

Solution (Python):
N,A,B = map(int,input().split())
S = input()

total = 0
b = 0
answer = []

for s in S:
  bl = False
  if s == 'a':
    if total < A+B:
      bl = True
      total += 1
  elif s == 'b':
    if total < A+B and b < B:
      bl = True
      total += 1
      b += 1
  answer.append('Yes' if bl else 'No')
  
print(*answer, sep='\n')

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,a,b = LI()
    s = input()
    su = sb = 0
    c = a+b
    for i in range(n):
        if su >= c:
            print("No")
            continue
        if s[i] == "a":
            su += 1
            print("Yes")
        elif s[i] == "b":
            if sb < b:
                su += 1
                sb += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    return


if __name__ == "__main__":
    solve()

Solution (Python):
def resolve():
    N, A, B = map(int, input().split())
    ca = cb = 0
    for s in input():
        if s == "c":
            print("No")
        elif s == "a" and ca < A + B:
            print("Yes")
            ca += 1
        elif s == "b" and ca < A + B and cb < B:
            print("Yes")
            ca += 1
            cb += 1
        else:
            print("No")


if __name__ == "__main__":
    resolve()

Solution (Python):
N, A, B = map(int, input().split())
S = input()
l = list(S)


k = 0
for i in range(0, N):
    if l[i] == 'c':
        l[i] = 'No'
    elif l[i] == 'a' and k < A+B:
        l[i] = 'Yes'
        k += 1
    elif l[i] == 'b' and k < A+B:
        l[i] = 'passedb'
        k += 1
        
        


m = 0
for j in range(0, N):
    if l[j] == 'passedb':
        if m < B:
            l[j] = 'Yes'
            m += 1
        else:
            l[j] = 'No'
    
    elif l[j] == 'b':
        l[j] = 'No'
    


t = 0
for k in range(N):
    if l[k] == 'Yes':
        t += 1
    elif l[k] == 'a' and t < A+B:
        l[k] = 'Yes'
        t += 1
    else:
        l[k] = 'No'

for i in range(N):
    print(l[i])

Solution (Python):
N, A, B = map(int, input().split())
S = input()
a = b = 0
for s in S:
  if a + b == A + B:
    print('No')
  elif s == 'c':
    print('No')
  elif s == 'a':
    if a + b < A + B:
      print('Yes')
      a += 1
    else:
      print('No')
  else: 
    if a + b < A + B and b < B:
      print('Yes')
      b += 1
    else:
      print('No')

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))

def main():
    N,A,B=map(int,input().split())
    S=list(input())
    c=0
    cc=0
    for i in range(N):
        if S[i]=='a':
            c+=YesNo(c<A+B)
        elif S[i]=='b':
            tmp=YesNo(c<A+B and cc<B)
            c+=tmp
            cc+=tmp
        else:
            YesNo(0)

if __name__ == '__main__':
    main()

f3=lambda b: bool([print('Yes')] if b else print('No'))

Solution (Python):
n, a, b = map(int, input().split())
s = input()
maxim = a + b
foreign = 1
through = 0
for c in s:
    if c == 'a' and through < maxim:
        print('Yes')
        through += 1
    elif c == 'b' and through < maxim and foreign <= b:
        print('Yes')
        through += 1
        foreign += 1
    else:
        print('No')

Solution (Python):
N,A,B = map(int, input().split())
S = input()
ok = 0
ok_b = 0

for i in range(N):
  if S[i] == 'a':
    if ok < A+B:
      print('Yes')
      ok += 1
    else:
      print('No')
  elif S[i] == 'b':
    if ok < A+B and ok_b < B:
      print('Yes')
      ok += 1
      ok_b += 1
    else:
      print('No')
  else:
    print('No')

Solution (Python):

n, a, b = map(int, input().split())
s = input()

c = 0
abroad = 0
for i in range(n):
    if s[i] == 'c':
        print('No')
    elif s[i] == 'a' and c < a + b:
        print('Yes')
        c += 1
    elif s[i] == 'b' and c < a + b and abroad < b:
        print('Yes')
        abroad += 1
        c += 1
    else:
        print('No')

Solution (Python):
n,a,b=map(int,input().split())
A,B=0,0
for i in input():
  if i=="a":
    if A+B<a+b:
      print("Yes")
      A+=1
    else:
      print("No")
  elif i=="b":
    if A+B<a+b and B<b:
      print("Yes")
      B+=1
    else:
      print("No")
  else:
    print("No")

Solution (Python):
N,A,B=map(int,input().split(' '))
S=input()
n = 0
b = 0
for i in S:
    if (i=='a' and n < A+B) or(i=='b' and n<A+B and b<B):
        print('Yes')
        if i=='b':
            b += 1
        n += 1
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()
passed = 0
foregin_passed = 0

for i in range(N):
    if S[i] == 'a':
        if passed < A + B:
            passed += 1
            print("Yes")
        else:
            print("No")
    elif S[i] == 'b':
        if passed < A + B and foregin_passed < B:
            passed += 1
            foregin_passed += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):


N, A, B = list(map(int, input().split()))
S = input()
k = 0
ans = ""
b_i = 0
for i, ch in enumerate(S):

    if ch == "b":
        b_i += 1
    r = "No"
    if ch == "a" and k < A + B:
        r = "Yes"
        k += 1
    elif ch == "b" and k < A + B and b_i <= B:
        r = "Yes"
        k += 1
    ans += r + "\n"

print(ans)

Solution (Python):
N, A, B = list(map(int, input().split()))
S = input()
passed_num = 0
passed_foreigners_num = 0
for i in S:
    if passed_num < A + B:
        if i == 'a':
            print('Yes')
            passed_num += 1 
        elif i == 'b' and passed_foreigners_num < B:
            print('Yes')
            passed_num += 1 
            passed_foreigners_num += 1
        else:
            print('No')
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())

n = 0
f = 0
for s in S:
    if s == "c":
        print("No")
    elif s == "a":
        if n < A + B:
            n += 1
            print("Yes")
        else:
            print("No")
    else:
        f += 1
        if n < A + B and f <= B:
            n += 1
            print("Yes")
        else:
            print("No")

Solution (Python):
n,a,b = map(int,input().split())
s = input()
cnt = 0
kaigai = 0
for i in range(n):
    if s[i] == "a":
        if a+b > cnt:
            print("Yes")
            cnt += 1
        else:
            print("No")
    elif s[i] == "b":
        if a+b > cnt and kaigai < b:
            print("Yes")
            kaigai += 1
            cnt += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
a,b,c=map(int,input().split())
na=0
nb=0
s=input()
for i in range(a):
  if s[i]=='a':
    if na+nb<b+c:
      print('Yes')
      na+=1
    else:
      print('No')
  elif s[i]=='b':
    if na+nb<b+c and nb<c:
      print('Yes')
      nb+=1
    else:
      print('No')
  else:
    print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = input()

for i in range(n):
  if s[i] == "c":
    print("No")
  elif s[i] == "b" and b:
    print("Yes")
    b -= 1
  elif s[i] == "a" and a:
    print("Yes")
    a -= 1
  elif s[i] == "a" and b:
    print("Yes")
    b -= 1
  else:
    print("No")

Solution (Python):
def main():
    N, A, B = map(int, input().split())
    S = input()

    passed = 0
    passed_b = 0
    for i in range(len(S)):
        if S[i] == 'c':
            print('No')
            continue
        if passed >= A + B:
            print('No')
            continue
        if S[i] == 'b':
            if passed_b < B:
                print('Yes')
                passed += 1
                passed_b += 1
            else:
                print('No')
        else:
            print('Yes')
            passed += 1


if __name__ == '__main__':
    main()

Solution (Python):
n, a, b = map(int, input().split())
s=input()

tp=0
up=0

for i in range(n):
  if tp >= a+b:
    print('No')
  elif s[i]=='a':
    print('Yes')
    tp+=1
  elif s[i]=='b':
    if up < b:
      print('Yes')
      tp+=1
      up+=1
    else:
      print('No')
  else:
    print('No')

Solution (Python):


n,a,b = map(int, input().split())
s=input()

b_all=a+b
n_all=0
n_int=0
for i in s:
    if i=='a':
        if n_all<b_all:
            n_all+=1
            print("Yes")
        else:
            print("No")
    elif i=='b':
        if n_all<b_all and n_int<b:
            n_all+=1
            n_int+=1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
n,a,b = map(int,input().split())
ab = 0
b1 = 0
for i in list(input()):
    if i == "a":
        if ab < a+b:
            print("Yes")
            ab +=1
        else:
            print("No")
    elif i == "b":
        if ab < a+b and b1 < b:
            ab += 1
            b1 += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
N, A, B = map(int, input().split())
s = str(input())

passed = []
count = 0
for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and count < B:
    passed.append(s[i])
    count += 1
    print("Yes")
  else:
    print("No")

Solution (Python):
import sys
input = sys.stdin.readline


def read():
    N, A, B = map(int, input().strip().split())
    S = input().strip()
    return N, A, B, S

def solve(N, A, B, S):
    na = 0
    nb = 0
    for s in S:
        if s == 'a' and na + nb < A + B:
            na += 1
            print('Yes')
        elif s == 'b' and na + nb < A + B and nb < B:
            nb += 1
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    inputs = read()
    solve(*inputs)

Solution (Python):
n,A,B = map(int, input().split(' '))
S = input()

j=0
f=0

for  s in S:
    yosentoppa = False
    if s == "c":
        pass
    elif j+f < A+B:
        if s == "a":
            j+=1    
            yosentoppa = True
        else:
            if f<B:
                yosentoppa = True
                f+=1
    print (['No','Yes'][yosentoppa])

Solution (Python):
N,A,B= map(int,input().split())
S=input()
sanka=0
kaigai=0

for i in range(N):
  if S[i]=="a":
    if sanka< A+B:
      print("Yes")
      sanka += 1
    else:
      print("No")
  elif S[i]=="b":
    if sanka < A+B and kaigai <B:
      print("Yes")
      sanka += 1
      kaigai += 1
    else:
      print("No")    
  else:
    print("No")

Solution (Python):
total, a, b = map(int, input().split())
list = list(input())

passed = 0;
b_passed = 0;
for i, item in enumerate(list):
    if (item == "a" and passed < a + b):
        print("Yes")
        passed += 1
    elif (item == "b" and passed < a + b and b_passed < b):
        print("Yes")
        passed += 1
        b_passed += 1
    else:
        print("No")

Solution (Python):
N, a, b = map(int, input().split())
S = list(input())
ia = 0
ib = 0
for s in S:
    if s == "a" and ia+ib < a+b:
        print("Yes")
        ia += 1
        continue
    if s == "b" and ia+ib < a+b and ib < b:
        print("Yes")
        ib += 1
        continue
    print("No")

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())

SS = ["No"]*len(S)
count = 0
countb = 0

for i in range(len(S)):
  if count == A+B:
      break
  if S[i] == "a":
    SS[i] = "Yes"
    count += 1
  elif S[i] == "b" and countb < B:
    SS[i] = "Yes"
    count +=1
    countb += 1

print('\n'.join(SS))

Solution (Python):
n,a,b=map(int,input().split())
s=list(input())
count=0
cnt=0
for i in range(n):
  if(cnt>=a+b):
    print("No")
  else:
    if(s[i]=="a"):
      print("Yes")
      cnt+=1
    elif(s[i]=="b"):
      if(count<b):
        print("Yes")
        count+=1
        cnt+=1
      else:
        print("No")
    else:
      print("No")

Solution (Python):
n,a,b=map(int,input().split())
s=list(input())
count=0
cnt=0
for i in range(n):
  if(cnt>=a+b):
    print("No")
  else:
    if(s[i]=="a"):
      print("Yes")
      cnt+=1
    elif(s[i]=="b"):
      if(count<b):
        print("Yes")
        count+=1
        cnt+=1
      else:
        print("No")
    else:
      print("No")

Solution (Python):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, a, b = inpl()
s = list(input())
ans = []
t = 0
f_s = 0
for v in s:
    if v == 'a':
        if t < (a + b):
            ans.append('Yes')
            t += 1
        else:
            ans.append('No')
    if v == 'b':
        f_s += 1
        if t < (a + b) and f_s <= b:
            ans.append('Yes')
            t += 1
        else:
            ans.append('No')
    if v == 'c':
        ans.append('No')
for i in ans:
    print(i)

Solution (Python):
def main():
    N, A, B = map(int, input().split())
    S = input()

    count = 0
    countB = 0
    for c in S:
        if count >= A+B:
            print("No")
        else:
            if c == "a":
                print("Yes")
                count += 1
            elif c == "b":
                if countB >= B:
                    print("No")
                else:
                    print("Yes")
                    count += 1
                    countB += 1
            else:
                print("No")


main()

Solution (Python):
N, A, B = map(int, input().split())

S = input()
count = 0
c_for = 0
for i in range(N):
    if count < A+B:
        if S[i] == 'a':
            print('Yes')
            count += 1
        elif S[i] == 'b':
            if c_for < B:
                print('Yes')
                count += 1
                c_for += 1
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = input()
ans = []
domestic = 0
or_abroad = 0
for c in s:
    if c == 'a' and domestic + or_abroad < a + b:
        ans.append('Yes')
        domestic += 1
    elif c == 'b' and domestic + or_abroad < a + b and or_abroad < b:
        ans.append('Yes')
        or_abroad += 1
    else:
        ans.append('No')
print('\n'.join(ans))

Solution (Python):
N, A, B = map(int, input().split())
L = str(input())

total = 0
kaigai = 0

for i in range(0, len(L)):
	if L[i] == 'a':
		if total < A + B:
			print('Yes')
			total += 1
		else:
			print('No')
	elif L[i] == 'b':
		if total < A + B and kaigai < B:
			print('Yes')
			total += 1
			kaigai += 1
		else:
			print('No')
	else:
		print('No')

Solution (Python):
n,a,b = map(int,input().split())
s = input()
ans = ["0"]*n
acnt = 0
bcnt = 0
for i in range(n):
  if s[i] == "a":
    if acnt < a+b:
      acnt += 1
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  elif s[i] == "b":
    bcnt += 1
    if acnt < a+b and bcnt <= b:
      acnt += 1
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  else:
    ans[i] = "No"
print(*ans,sep='\n')

Solution (Python):
n, a, b = map(int, input().split())
s = input()

limit = a + b
cnt_b = 0
for v in s:
    if v == "a":
        if limit > 0:
            print("Yes")
            limit -= 1
            continue
        else:
            print("No")
            continue
    elif v == "b":
        cnt_b += 1
        if limit > 0 and cnt_b <= b:
            print("Yes")
            limit -= 1
            continue
        else:
            print("No")
            continue
    else:
        print("No")
        continue