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 = [ int(v) for v in input().split() ]
s = input()
total, abroad = 0, 0
for i in s:
    ans = "No"
    if i == "a":
        if total < a + b:
            total += 1
            ans = "Yes"
    elif i == "b":
        if total < a + b and abroad < b:
            total += 1
            abroad += 1
            ans = "Yes"
    print(ans)

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

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

if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
n,a,b = map(int,input().split())
t = 0
t1 = 1

s = input()
for i in range(n):
    if s[i]=="a":
        if t < a+b:
            print("Yes")
            t += 1
        else:
            print("No")
    elif s[i] == "b":
        if t < a+b and t1 <= b:
            print("Yes")
            t1 += 1
            t += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):

def main():
    N, A, B = tuple(map(int, input().split()))
    S = input()
    ans, x, y = [], 0, 0
    for i in S:
        if (i == "a" and x < A + B) or (i == "b" and x < A + B and y < B):
            ans += ["Yes"]
            x += 1
            y += 1 if i == "b" else 0
        else:
            ans += ["No"]
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()

Solution (Python):

def main():
    N, A, B = tuple(map(int, input().rstrip().split()))
    S = input().rstrip()
    ans, a, b = [], 0, 0
    for i in S:
        if i == "a":
            if a < A + B:
                ans += ["Yes"]
                a += 1
            else:
                ans += ["No"]
        elif i == "b":
            if a < A + B and b < B:
                ans += ["Yes"]
                a += 1
                b += 1
            else:
                ans += ["No"]
        else:
            ans += ["No"]
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()

Solution (Python):
n, a, b = map(int, input().split())
s = input()
u = v = 0
for x in s:
    if u == a+b or x == 'c':
        print('No')
    elif x == 'a':
        print('Yes')
        u += 1
    else:
        if v == b:
            print('No')
        else:
            print('Yes')
            u += 1
            v += 1

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

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

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

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

num_passed = 0
b_passed = 0

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

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

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

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

Solution (Python):
n, a, b = [int(item) for item in input().split()]
s = input().rstrip()

domestic = 0; foreign = 0
for item in s:
    if item == "a":
        if domestic + foreign < a + b:
            print("Yes")
            domestic += 1
        else:
            print("No")
    elif item == "b":
        if domestic + foreign < a + b and foreign < b:
            print("Yes")
            foreign += 1
        else:
            print("No")
    elif item == "c":
        print("No")

Solution (Python):

import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
sys.setrecursionlimit(10**7)

dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())


N, A, B = mi()
S = input()

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

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

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

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


if __name__ == "__main__":
    main()

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

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

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

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

ac, bc = 0, 0
for s in S:
	if "a" == s:
		if (ac + bc) < (A + B):
			ac += 1
			print("Yes")
		else:
			print("No")
	elif "b" == s:
		if (ac + bc) < (A + B) and (bc < B):
			bc += 1
			print("Yes")
		else:
			print("No")
	else:
		print("No")

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

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

a = 0
b = 0

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

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

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

Solution (Python):
from collections import Counter
import math
N,A,B = map(int,input().split())
S = input()
a_count = 0
b_count = 0
for i in range(N):
	if S[i] == "a":
		if a_count + b_count > A + B -1:
			print("No")
		else:
			print("Yes")
			a_count += 1
	elif S[i] == "b":
		if A + B >= a_count + b_count + 1 and B >= b_count + 1 :
			print("Yes")
			b_count += 1
		else:
			print("No")
	else:
		print("No")

Solution (Python):
from collections import Counter
import math
N,A,B = map(int,input().split())
S = input()
a_count = 0
b_count = 0
for i in range(N):
	if S[i] == "a":
		if a_count + b_count > A + B -1:
			print("No")
		else:
			print("Yes")
			a_count += 1
	elif S[i] == "b":
		if A + B >= a_count + b_count + 1 and B >= b_count + 1 :
			print("Yes")
			b_count += 1
		else:
			print("No")
	else:
		print("No")

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

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

count_b = 0
count = 0
ans = ['No']*N
for j,i in enumerate(S):
    if i == 'a':
        if count < A+B:
            ans[j] = 'Yes'
            count += 1
    elif i == 'b':
        if count < A+B and count_b < B:
            ans[j] = 'Yes'
            count += 1
            count_b += 1

[print(i) for i in ans]

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):
n,a,b = map(int,input().split())
s = input()
total = a+b
cnt_t = 0
cnt_b = 0
for i in s:
  if i == 'a' and total > cnt_t:
    print('Yes')
    cnt_t += 1
  elif i == 'b' and total > cnt_t and b > cnt_b:
    print('Yes')
    cnt_t += 1
    cnt_b += 1
  else:
    print('No')

Solution (Python):

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

Solution (Python):
N,A,B = [int(x) for x in input().split()]
S = input()
domestic = 0
foreign = 0

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

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

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

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

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

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

all_passed = 0
foreign_passed = 0
for s in S :
    if (s == 'a' and all_passed < A+B) :
        all_passed += 1
        print("Yes")
        continue
    
    if (s == 'b' and all_passed < A+B and foreign_passed < B) :
        all_passed += 1
        foreign_passed += 1
        print("Yes")
        continue
    
    print("No")

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

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

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

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

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

    if p == "c":
        print("No")

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

Solution (Python):

"""
B - Qualification simulator
https://atcoder.jp/contests/code-festival-2016-qualb/tasks/codefestival_2016_qualB_b

"""
import sys


def solve(N, A, B, S):
    ans = []
    total_qualified = 0
    b_qualified = 0
    for ch in S:
        if ch == 'a':
            if total_qualified < A+B:
                ans.append('Yes')
                total_qualified += 1
            else:
                ans.append('No')
        elif ch == 'b':
            if total_qualified < A+B and b_qualified < B:
                ans.append('Yes')
                total_qualified += 1
                b_qualified += 1
            else:
                ans.append('No')
        else:
            ans.append('No')
    return ans


def main(args):
    N, A, B = map(int, input().split())
    S = input()
    ans = solve(N, A, B, S)
    print(*ans, sep='\n')


if __name__ == '__main__':
    main(sys.argv[1:])

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

cnt1=0
cnt2=0
for i in range(N):
    if S[i]=="a" and cnt1<(A+B):
        print("Yes")
        cnt1+=1
    elif S[i]=="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()
tsuuka=0
kaigai=0

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

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

a = 0
b = 0
for i in range(N):
    if S[i] == 'a':
        if a + b < A + B:
            print("Yes")
            a += 1
        else:
            print("No")
    elif S[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()
qual=0
foreignQual=0
for t in S:
    if qual<A+B:
        if t=="a":
            qual+=1
            print("Yes")
        elif t=="b" and foreignQual<B:
            qual+=1
            foreignQual+=1
            print("Yes")
        else:print("No")
    else:print("No")

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

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

Solution (Python):

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

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

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

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

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

ans = []
num_passed = 0
num_foreign = 0
for ch in S:
    if ch == "a":
        ans.append(num_passed < A + B)
    elif ch == "b":
        num_foreign += 1
        ans.append((num_passed < A + B) and (num_foreign <= B))
    else:
        ans.append(False)

    num_passed += 1 if ans[-1] else 0

print("\n".join(map(lambda x: "Yes" if x else "No", ans)))

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N,A,B=MAP()
S=input()

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

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

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

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

sumy = 0
sumf = 0
for _s in s:
  if _s == 'c':
    print('No')
  elif _s == 'a':
    if sumy < a + b:
      print('Yes')
      sumy += 1
    else:
      print('No')
  else:
    if sumy < a + b and sumf < b:
      print('Yes')
      sumy += 1
      sumf += 1
    else:
      print('No')

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

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

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

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

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

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

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

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

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

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

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


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

Solution (Python):
n,a,b=map(int,input().split())
count=0
fcount=0
for s in input():

    if s=="c":
        print("No")
    elif s=="a":
        if count<a+b:
            print("Yes")
            count+=1
        else:
            print("No")
    else:
        fcount+=1
        if count<a+b and fcount<=b:
            print("Yes")
            count+=1
        else:
            print("No")

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