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())
s = input()
count = 0
rank = 1

for i in range(len(s)):
    tmp = s[i]
    if tmp == 'a':
        if count < a + b:
            print("Yes")
            count += 1
        else:
            print("No")
    elif tmp == 'b':
        if count < a + b and rank <= b:
            print("Yes")
            count += 1
            rank += 1
        else:
            print("No")
    else:
        print("No")

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

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

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

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

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

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

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

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

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

Solution (Python):
from collections import Counter

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

if B > len(S):
    B = len(S)
if A + B > len(S):
    AB = len(S)
count = 0
countB = 0

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

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

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

for i in s:
    if i == 'a' :
        if cnt < a+b:
            cnt+=1
            print('Yes')
        elif cnt >= a+b:
            print('No')
    
    elif i == 'b':
        if cnt < a+b and cnt_b < b:
            cnt +=1
            cnt_b +=1
            print('Yes')
        elif cnt >= a+b or cnt_b >= b:
            print('No')
    
    elif i == 'c':
        print('No')

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

Count=0
b=0
for i in range(N):
    if Count<A+B:
        if S[i]!="c":
                if S[i]=="b":
                    if b<B:
                        print("Yes")
                        b+=1
                        Count+=1
                    else:
                        print("No")
                else:
                    print("Yes")
                    Count+=1
        else:
            print("No")
    else:
        print("No")

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, a, b = map(int, input().split())
    S = str(input())
    cnta=0
    cntb=0

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

        else:
            print('No')


resolve()

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

Solution (Python):
n,a,b = map(int,input().split())
s = list(input())
yosen = 0
gaikoku = 0
for i,si in enumerate(s):
    if si == 'a':
        if yosen < a+b:
            print('Yes')
            yosen += 1
        else:
            print('No')
    elif si == 'b':
        if yosen < a+b and gaikoku <b:
            print('Yes')
            yosen += 1
            gaikoku += 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 s:
  if i == 'a' and a+b < A+B:
    print('Yes')
    a += 1
  elif i == '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 = list(input())

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

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


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

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

total_cnt = 0
b_cnt = 0
ans = ["No"]*n

for i in range(n):
    if total_cnt >= a+b:
        break
    if s[i] == "c":
        continue
    if s[i] == "a":
        total_cnt += 1
        ans[i] = "Yes"
    if s[i] == "b":
        b_cnt += 1
        if b_cnt <= b:
            total_cnt += 1
            ans[i] = "Yes"

for i in range(n):
    print(ans[i])

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

qualified = 0
qualified_foreign = 0.
for s in S:
    if s == 'c':
        print('No')
    elif s == 'a':
        if qualified < A + B:
            print('Yes')
            qualified += 1
        else:
            print('No')
    else:
        if (qualified < A + B) & (qualified_foreign < B):
            print('Yes')
            qualified += 1
            qualified_foreign += 1
        else:
            print('No')

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

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

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

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

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

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

count_b = 0
count_total = 0
ans = ["No"] * N

for i in range(N):
    if count_total >= A+B:
        break

    if S[i] == "c":
        continue
    if S[i] == "a":
        count_total += 1
        ans[i] = "Yes"
    if S[i] == "b":
        count_b += 1
        if count_b <= B:
            count_total += 1
            ans[i] = "Yes"
    

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

Solution (Python):
n,a,b=map(int,input().split())
s=input()
os=int(0)
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 os<b and a+b>0:
        print("Yes")
        os+=1
        a-=1
    else:
        print("No")

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

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

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

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

Solution (Python):
def myAnswer(A: int, B: int, S: list) -> None:
    counter = 0
    foreignStu = 1
    for i, s in enumerate(S):
        if(s == 'a' and counter < (A + B)): 
            print("Yes")
            counter += 1
        elif(s == 'b' and counter < (A + B) and foreignStu <= B): 
            print("Yes")
            counter += 1
            foreignStu += 1
        else:
            print("No")


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


if __name__ == "__main__":
    main()

Solution (Python):

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

S = list(input())
counter = 0
oversea= 1
for i,s in enumerate(S):
    if(s == 'a'):
        if(counter < (A + B)):
            print("Yes")
            counter+=1
        else:
            print("No")
    elif(s == 'b'):
        if(counter < (A + B) and  oversea <= B):
            print("Yes")
            counter+=1
            oversea +=1
        else:
            print("No")
    else:
        print("No")

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

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

Solution (Python):
n,a,b = map(int,input().split())
s = input()
cnt = 0
ovs = 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 ovs < b:
            print("Yes")
            cnt +=1
            ovs += 1
        else:
            print('No')
    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")        
    else:
        print("No")

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

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
from functools import lru_cache, reduce
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	n,a,b = MI()
	S = IS()
	cnt = 0
	frank = 1
	for i,s in enumerate(S):
		if s == 'a':
			if cnt < a+b:
				cnt += 1
				print("Yes")
			else:
				print("No")
		elif s == 'b':
			if cnt < a+b and frank <= b:
				cnt += 1
				frank += 1
				print("Yes")
			else:
				print("No")
		else :
			print("No")

if __name__ == '__main__':
	main()

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

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

Solution (Python):
n, a, b = map(int, input().split(' '))
S = input()
acc = 0
acc_b = 0
ans = ''
i = 0
for s0 in S:
    if acc >= (a+b) or s0 == 'c':
        ans += 'No\n'
    elif s0 == 'a':
        ans += 'Yes\n'
        acc += 1
    elif acc_b < b:
        ans += 'Yes\n'
        acc += 1
        acc_b += 1
    else:
        ans += 'No\n'
print(ans)

Solution (Python):
import sys
input=sys.stdin.readline
n,a,b=map(int,input().split())
s=input()
nin=0
fr=0;l=[""]*n
for i in range(n):
    l[i]="No"
    if s[i]=="a" and nin<a+b:nin+=1;l[i]="Yes"
    elif s[i]=="b":
        if fr+1<=b and nin<a+b:nin+=1;fr+=1;l[i]="Yes"
    
print(*l,sep="\n")

Solution (Python):
N, A, B = map(int, input().split())
S = input()
a = 0
b = 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()

n_p = n_f = 0

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

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

  print("No")

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

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

nd = ni = 0
for s in S:
    if s == 'a':
        if nd + ni < A + B:
            nd += 1
            ans = True
        else:
            ans = False
    elif s == 'b':
        if nd + ni < A + B and ni < B:
            ni += 1
            ans = True
        else:
            ans = False
    else:
        ans = False
    print('Yes' if ans else 'No')

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

num_pass = 0
num_pass_kaigai = 0

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

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

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

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

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

nA = 0
nB = 0

for ch in S:
    if ch == 'a':
        if nA + nB < A + B:
            print("Yes")
            nA += 1
        else:
            print("No")
    elif ch == 'b':
        if nA + nB < A + B and nB < B:
            nB += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,a,b = iim()
cap = a+b
cA = 0
cB = 0

s = input()

for i in s:
    if i == 'a':
        if cA+cB < cap:
            cA += 1
            print('Yes')
        else:
            print('No')
    elif i == 'b':
        if cA+cB < cap and cB < b:
            cB += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

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

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

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    b = 0
    N, A, B =LI()
    s = S()
    PASS = 0
    for i in range(N):
        if s[i] == "c":
            print("No")
            continue
        if PASS < A + B:
            if s[i] == "a":
                PASS += 1
                print("Yes")
            else:
                if b < B:
                    PASS += 1
                    b += 1
                    print("Yes")
                else:
                    print("No")
        else:
            print("No")

    return



if __name__ == '__main__':
    solve()

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

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

win = 0
inter = 1
ans = []
for i in range(len(S)):
    if S[i] == "a":
        if win < A + B:
            ans.append("Yes")
            win += 1
        else:
            ans.append("No")
    elif S[i] == "b":
        if win < A + B and inter <= B:
            ans.append("Yes")
            win += 1
        else:
            ans.append("No")
        inter += 1
    else:
        ans.append("No")

for a in ans:
    print(a)

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

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

S = list(input())

t = 0
s = 0

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

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

num_japan_student = 0
num_foreign_student = 0
ans_list = ["No"] * N
for i in range(N):
    if S[i] == 'a':
        num_japan_student += 1
        if num_japan_student + num_foreign_student <= A + B:
            ans_list[i] = "Yes"
    elif S[i] == 'b':
        num_foreign_student += 1
        if num_foreign_student <= B and num_japan_student + num_foreign_student <= A + B:
            ans_list[i] = "Yes"
        else:       
            num_foreign_student -= 1
    else:
        pass

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