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):



import sys  
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools



sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
def dump(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)


def local_input():
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)


def solve():
    N, A, B = map(int, input().split())
    S = input()

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

if __name__ == "__main__":
    try:
        local_input()
    except:
        pass
    solve()

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

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

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

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

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

anss = ['No'] * N
numA = numB = 0
for i, S in enumerate(Ss):
    if S == 'a':
        if numA + numB < A + B:
            anss[i] = 'Yes'
            numA += 1
    elif S == 'b':
        if numA + numB < A + B and numB < B:
            anss[i] = 'Yes'
            numB += 1

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

Solution (Python):
N,A,B = map(int,input().split())
S = str(input())
for i in range(N):
    r = A + B
    if S[i] == "c":
        print("No")
    else:
        if S[i] == "a" and r > 0:
            print("Yes")
            if A >= 1:
                A -= 1
            else:
                B -= 1
        elif S[i] == "b" and B > 0:
            print("Yes")
            B -= 1
        else:
            print("No")

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

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

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

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

Solution (Python):
N, A, B = map( int, input().split())
S = input()
ans = ""
ab = 0
b=0
AB = A+B
for i in range(N):
    if S[i] == "c":
        print("No")
        continue
    if S[i] == "a":
        if ab < AB:
            ab += 1
            print("Yes")
        else:
            print("No")
    else:
        if b < B and ab < AB:
            b += 1
            ab += 1
            print("Yes")
        else:
            print("No")

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,a,b = li()
s = ns()

cnt = 0
frank = 1

for i, si in enumerate(s):
    if si == 'a':
        if cnt < a+b:
            cnt += 1
            print("Yes")
        else:
            print("No")
            
    elif si == 'b':
        if cnt < a+b and frank <= b:
            cnt += 1
            frank += 1
            print("Yes")
        else:
            print("No")
            
    else:
        print("No")

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

ans = ['No'] * N
p = b = 0
for i,c in enumerate(S):
    if c == 'a':
        if p < A+B:
            ans[i] = 'Yes'
            p += 1
    elif c == 'b':
        if p < A+B and b < B:
            ans[i] = 'Yes'
            p += 1
            b += 1
print(*ans,sep='\n')

Solution (Python):
import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)

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

kaigai = 0
all = 0

for c in s:
    if c == 'a':
        if all < a + b:
            all += 1
            print('Yes')
        else:
            print('No')
    if c == 'b':
        if all < a + b and kaigai < b:
            all += 1
            kaigai += 1
            print('Yes')
        else:
            print('No')
    if c == 'c':
        print('No')

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

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

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

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

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

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

Solution (Python):
N,A,B = map(int,input().split())
L = list(input())
p = 0
q = 0
for i in range(N) :
    if L[i] == "c" :
        print("No")
    elif L[i] == "a" :
        if p < A+B :
            p += 1
            print("Yes")
        else :
            print("No")
    else :
        if (p < (A+B)) and (q < B) :
            p += 1
            q += 1
            print("Yes")
        else :
            print("No")

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

for s in S:
    if s == 'a' and A+B > 0:
        if A != 0:
            A -= 1
        else:
            B -= 1
        print('Yes')
    elif s == 'b' and B > 0:
        B -= 1
        print('Yes')
    else:
        print('No')

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

count = 0
b_count = 0
for s in S:
    if s == "a":
        if count < A + B:
            print("Yes")
            count += 1
            continue

    elif s == "b":
        if count < A + B and b_count < B:
            print("Yes")
            count += 1
            b_count += 1
            continue

    print("No")

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

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

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

Solution (Python):
n,a,b=map(int, input().split())
al=0
kai=0
for i in input():
    ans='No'
    if i=='a':
        if al<a+b:
            ans='Yes'
            al+=1
    if i=='b':
        if al<a+b and kai<b:
            ans='Yes'
            al+=1
            kai+=1
    print(ans)

Solution (Python):
n,a,b = map(int, input().split())
s = list(str(input()))
count_all = 0
count_a = 0
count_b = 0
for person in s:
    if person == "a":
        if count_all < a+b:
            print("Yes")
            count_all += 1
        else:
            print("No")
    elif person == "b":
        if count_all < a+b and count_b < b:
            print("Yes")
            count_all += 1
            count_b += 1
        else:
            print("No")
    else:
        print("No")

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

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

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

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())
cnt = 0
fcnt = 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 fcnt < B:
            print("Yes")
            fcnt += 1
            cnt += 1
        else:
            print("No")
    elif S[i] == "c":
        print("No")

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

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N,A,B = inpl()
S = input()
tmp = 1
tmpf = 1

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

Solution (Python):
n,a,b=map(int,input().split())
for s in input():
  if s=='a':print('Yes'*(a+b>0)or'No');a-=1
  elif s=='b'and a+b>0and b>0:print('Yes');b-=1
  else:print('No')

Solution (Python):
n,a,b=map(int,input().split())
for s in input():
  if s=='a':
    print('Yes'*(a+b>0)or'No')
    a-=1
  elif s=='b'and a+b>0and b>0:
    print('Yes')
    b-=1
  else:
    print('No')

Solution (Python):
n,a,b = list(map(int,input().split()))
s = input()
y = 0
z = 0
for x in s:
    if x == 'a' and y+z<(a+b):
        print('Yes')
        y+=1
    elif x == 'b' and y+z<(a+b) and z<b:
        print('Yes')
        z+=1
    else:
        print('No')

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

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

passed = 0
oversea = 0
for s in S:
    if s == "a" and passed < A + B:
        passed += 1
        print("Yes")
        continue

    if s == "b" and passed < A + B and oversea < B:
        passed += 1
        oversea += 1
        print("Yes")
        continue

    print("No")

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

Solution (Python):
N,A,B = map(int, input().split(" "))
S = list(input())
MAX = A + B
nowall = 0
nowfor = 0

for i in range(len(S)):
    if nowall >= MAX:
        print("No")
    elif S[i] == "a":
        nowall += 1
        print("Yes")
    elif S[i] == "b":
        if nowfor < B:
            nowall += 1
            nowfor += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

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

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

Solution (Python):
N, A, B = list(map(int, input().split()))
S = input()
ans = [False for i in range(N)]
a_sum, b_sum = 0, 0
for i, S_i in enumerate(S):
    if S_i == 'a' and a_sum+b_sum < A+B:
        a_sum += 1
        ans[i] = True
    elif S_i == 'b' and a_sum+b_sum < A+B and b_sum < B:
        b_sum += 1
        ans[i] = True

for ans_i in ans:
    if ans_i:
        print('Yes')
    else:
        print('No')

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

Solution (Python):





if __name__ == '__main__':
    n, a, b = list(map(int, input().split()))
    s = input()
    a_count = 0
    b_count = 0
    a_b_count = 0

    for si in s:
        if (si == 'a') and (a_b_count < a + b):
            a_count += 1
            print('Yes')
        elif (si == 'b') and (a_b_count < a + b) and (b_count < b):
            b_count += 1
            print('Yes')
        else:
            print('No')

        a_b_count = a_count + b_count

Solution (Python):
N,A,B = [int(i) for i in input().split()]
S = input().strip()

qualifying = ['No' for _ in range(N)]
qualifying_total = 0
rank_oversea = 1

for i,h in enumerate(S):
  if h == 'a':
    if qualifying_total < A+B:
      qualifying[i] = 'Yes'
      qualifying_total += 1
  elif h == 'b':
    if qualifying_total < A+B and rank_oversea <= B:
      qualifying[i] = 'Yes'
      qualifying_total += 1
      rank_oversea += 1
ans = '\n'.join(qualifying)
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
s = input().rstrip()
count = 0
countB = 0
for i in range(N):
  if A+B <= count:
    print('No')
  else:
    if s[i] == 'a':
      print('Yes')
      count += 1
    elif s[i] =='b':
      if countB < B:
        print('Yes')
        countB += 1
        count += 1
      else:
        print('No')
    else:
      print('No')

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

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

Solution (Python):
N, A, B = map(int, input().split())
S = input()
winner = ''
winner_f = ''
for i in S:
    if i == 'a':
        if len(winner)<A+B:
            print('Yes')
            winner += 'a'
        else:
            print('No')
    elif i == 'b':
        if len(winner)<A+B and len(winner_f)<B:
            print('Yes')
            winner += 'b'
            winner_f += 'b'
        else:
            print('No')
    else:
        print('No')

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

s = input()

for i in s:
    if i == 'c':
        print('No')
    elif i == 'a' and (a+b>=1):
        if a>0:
            a -= 1
        else:
            b -= 1
        print('Yes')
    elif i =='b' and b > 0:
        b -= 1
        print('Yes')
    else:
        print('No')

Solution (Python):
def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])
a = int(arr_data[0][1])
b = int(arr_data[0][2])

s = arr_data[1][0]
cnt = 0
cntb = 0

for v in s:
    
    chkflg = True
    
    if v == "c":
        
        chkflg = False
        
    elif v == "a":
                
        if cnt < a + b:
            
            cnt += 1
            
        else:
        
            chkflg = False
        
        
    elif v == "b":
        
        if cnt < a + b and cntb < b:
            
            cnt += 1
            cntb += 1
            
        else:
        
            chkflg = False
        
    print("Yes" if chkflg else "No")

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

plist = [False for i in range(N)]
p = 0
kp = 0
for i in range(N):
    if p>=A+B: break
    else:
        if S[i]=="a":
            p+=1
            plist[i] = True
        elif S[i]=="b" and kp<B:
            p+=1
            kp+=1
            plist[i] = True
            
for i in range(N):
    if plist[i]:
        print("Yes")
    else:
        print("No")

Solution (Python):
import sys


n,a,b=map(int,input().split())
s=input()
pas=0
fo=0
for i in s:
    if(i=="c"):print("No")
    elif(i=="a"):
        if(pas<(a+b)):
            print("Yes")
            pas+=1
        else:print("No")
    elif(i=="b"):
        if(pas<(a+b) and fo<b):
            print("Yes")
            pas+=1
            fo+=1
        else:print("No")

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

    AB = A+B
    n_passed = 0
    n_b = 0
    for s in S:
        passed = False
        if s == "a":
            if n_passed < AB:
                n_passed += 1
                passed = True
        elif s == "b":
            if n_passed < AB and n_b + 1 <= B:
                n_passed += 1
                n_b += 1
                passed = True
        
        if passed:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()

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

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

pa = pb = 0
for c in S:
    if c == 'a' and pa+pb < A+B:
        print('Yes')
        pa += 1
    elif c == 'b' and pa+pb < A+B and pb < B:
        print('Yes')
        pb += 1
    else:
        print('No')

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

Solution (Python):
n,a,b = map(int,input().split())
s = input()
for i in s:
    if i == "a":
        if a+b > 0:
            print("Yes")
            a -= 1
        else:
            print("No")
    if i == "b":
        if a+b > 0 and b > 0:
            print("Yes")
            b -= 1
        else:
            print("No")
    if i == "c": print("No")

Solution (Python):

N, A, B = map(int, input().split())
S = input()
nc = 0
bc = 1
for i in range(N):
    ans = False
    if S[i] == 'a' and nc < A + B:
        ans = True
        nc += 1
    elif S[i] == 'b' and nc < A + B and bc <= B:
        ans = True
        nc += 1
        bc += 1
    print('Yes' if (ans) else 'No')

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

p = 0
g = 0
for i in s:
    if i == 'a':
        if p < a + b:
            print 'Yes'
            p += 1
        else:
            print 'No'
    elif i == 'b':
        g += 1
        if p < a + b and g <= b:
            print 'Yes'
            p += 1
        else:
            print 'No'
    elif i == 'c':
        print 'No'
    else:
        print 'No'

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

count_dome = 0
count_fore = 0

for i in range(len(s)):
    if (s[i] == "c"):
        print("No")
    elif (s[i] == "a"):
        if (count_dome + count_fore < a + b):
            print("Yes")
            count_dome += 1
        else:
            print("No")
    else:
        if (count_dome + count_fore < a + b):
            if (count_fore < b):
                print("Yes")
                count_fore += 1
            else:
                print("No")
        else:
            print("No")

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

Solution (Python):





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

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

if __name__ == "__main__": main()

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

for s in S:
    if s == 'a':
        if A > 0:
            print('Yes')
            A -= 1
        elif B > 0:
            print('Yes')
            B -= 1
        else:
            print('No')
    elif s == 'b':
        if B > 0:
            print('Yes')
            B -= 1
        else:
            print('No')
    else:
        print('No')

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

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

Solution (Python):
def solve():
    N, A, B = list(map(int, input().split(" ")))
    S = list(input())
    pass_students = 0
    pass_foreigners = 0

    for s in S:
        if s == "a":
            if pass_students < A + B:
                print("Yes")
                pass_students += 1
            else:
                print("No")
        elif s == "b":
            if pass_students < A + B and pass_foreigners < B:
                print("Yes")
                pass_students +=1
                pass_foreigners += 1
            else:
                print("No")
        else:
            print("No")


solve()