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

cnt_a = 0
cnt_b = 0

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

Solution (Python):

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

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

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

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

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

passed = 0
outer = 0

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, A: int, B: int, S: str):
    ans = []
    passed = 0
    passed_b = calc_passed_b(S)
    for i, s in enumerate(S):
        if s == "a" and passed < A + B:
            
            passed += 1
            ans.append("Yes")
            continue
        if s == "b" and passed < A + B:
            
            if passed_b[i] <= B:
                passed += 1
                ans.append("Yes")
                continue

        ans.append("No")

    for a in ans:
        print(a)
    return


def calc_passed_b(S: str) -> "List[int]":
    pass_b = []
    passed = 0
    for s in S:
        if s == "b":
            passed += 1
        pass_b.append(passed)
    return pass_b



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    S = next(tokens)  
    solve(N, A, B, S)


if __name__ == "__main__":
    main()

Solution (Python):
il = [int(k) for k in input().split()]
S = input()
N = il[0]
A = il[1]
B = il[2]

S = "z"+S

passed = 0
passed_oversea = 0

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

Solution (Python):
(n,an,bn) = list(map(int,input().split()))
s = list(input())
count = 1
foreign = 1
for i in s:

  if i=='a' and an+bn >= count:
    print('Yes')
    count += 1
  elif i=='b' and an+bn >= count and bn >= foreign:
    print('Yes')
    count += 1
    foreign += 1
  else:
    print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()
a_cnt = 0
b_cnt = 0
p = 0
for i in range(N):
    if S[i] == 'a':
        a_cnt += 1
        if p < A + B:
            p += 1
            print("Yes")
        else:
            print("No")
    elif S[i] == 'b':
        b_cnt += 1
        if p < A + B and b_cnt <= B:
            p += 1
            print("Yes")
        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 == 'c':
    print('No')
  elif s == 'a':
    if a + b < A + B:
      print('Yes')
      a += 1
    else:
      print('No')
  else:
    if a + b < A + B and b < B:
      print('Yes')
      b += 1
    else:
      print('No')

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

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

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

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

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

for i in range(len(s)):
    if s[i] == "a":
        if p < a+b:
            print("Yes")
            p += 1
            continue

    elif s[i] == "b":
        if p < a+b and o <= b:
            print("Yes")
            p += 1
            o += 1
            continue

    print("No")

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

_pass = 0
_pass_foreign = 0
for i, v in enumerate(s):
    if _pass == a + b:
        print('No')
        continue
    if v == 'c':
        print('No')
    if v == 'a':
        print('Yes')
        _pass += 1
    if v == 'b':
        if _pass_foreign < b:
            print('Yes')
            _pass += 1
            _pass_foreign += 1
        else:
            print('No')

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

clears = 0
clears_foreigner = 0

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

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

clears = 0
clears_foreigner = 0

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

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

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

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

Solution (Python):

def insr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


n, a, b = invr()
S = insr()
os = 0
jp = 0
for s in S:
    if s == "a":
        if jp+os < a+b:
            jp += 1
            print("Yes")
        else:
            print("No")
    elif s == "b":
        if os+1 <= b and os+jp < a+b:
            os += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

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

all = 0
b = 0

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

Solution (Python):
longs, x, y = map(int, input().split())
s_lst = [v for v in input()]

cnt = 0
b_cnt = 0
for i, s in enumerate(s_lst):
    if s == 'a' and cnt < x + y:
        s_lst[i] = 'Yes'
        cnt += 1

    elif s == 'b':
        b_cnt += 1
        if cnt < x + y and b_cnt <= y:
            s_lst[i] = 'Yes'
            cnt += 1
        else:
            s_lst[i] = 'No'
    else:
        s_lst[i] = 'No'
for v in s_lst:
    print(v)

Solution (Python):
n,a,b = map(int, input().split())
s = input()
p = a+b
cnt = 0
bcnt = 0
for i in range(n):
    if s[i] == 'a' and cnt < p:
        print('Yes')
        cnt+=1
    elif s[i] == 'b' and cnt < p and bcnt < b:
        print('Yes')
        cnt+=1
        bcnt+=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' and A < a + b:
    A += 1
    print('Yes')
  elif S == 'b' and A < a + b and B < b:
    A += 1
    B += 1
    print('Yes')
  else:
    print('No')

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

Solution (Python):
import sys

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

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

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

cnt_all = 0
cnt_for = 0
ans = []
for i in range(n):
    c = "No"
    if s[i] == "a" and cnt_all < a + b:
        cnt_all += 1
        c = "Yes"
    if s[i] == "b" and cnt_all < a + b and cnt_for+1 <= b:
        cnt_for += 1
        cnt_all += 1
        c = "Yes"
    ans.append(c)
print("\n".join(ans))

Solution (Python):
N, A, B = [int(i) for i in input().split()]
S = input()
a = 0
b = 0
for i in range(N):
    s = S[i]
    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()

f_rank = 0
d_pass, f_pass = 0, 0
for s in S:
    if s == "b":
        f_rank += 1

    if s == "a" and d_pass + f_pass < A + B:
        print("Yes")
        d_pass += 1
    elif s == "b" and d_pass + f_pass < A + B and f_rank <= B:
        print("Yes")
        f_pass += 1
    else:
        print("No")

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

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

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

Solution (Python):

n, a, b = map(int, input().split())
passed_count = 0
oversea_rank= 0

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

Solution (Python):
def resolve():
    li = list(map(int,input().split()))
    N = int(li[0])
    A = int(li[1])
    anum = 0
    B = int(li[2])
    bnum = 0
    string = list(input())

    for i in range(N):
        if anum + bnum < A+B :
            if string[i] == "a":
                anum = anum + 1
                print("Yes")
            elif string[i] == "b" and bnum < B  :
                bnum = bnum + 1
                print("Yes")
            else:
                print("No")
        else:
            print("No") 
resolve()

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
from collections import defaultdict
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    N, A, B = map(int, input().split())
    S = input()[:-1]
    
    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")


if __name__ == '__main__':
    main()

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

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

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

cnt_s = 0
cnt_b = 0

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

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

cntA = 0
cntB = 0

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

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

passed = 1
passed_foreigners = 1
for c in S:
    if passed > A + B or c == 'c':
        print('No')
    elif c == 'a':
        print('Yes')
        passed += 1
    else:
        if passed_foreigners <= B:
            print('Yes')
            passed += 1
            passed_foreigners += 1
        else:
            print('No')

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

passed = 1
passed_foreigners = 1
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 passed_foreigners <= B:
            print('Yes')
            passed += 1
            passed_foreigners += 1
        else:
            print('No')
    else:
        print('No')

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

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

x = input()
y = list(x)
count_a = 0
count_b = 0

for i in range(0, N):
    if (y[i] == "a"):
        if(count_a + count_b < (A + B)):
            print("Yes")
            count_a += 1
        else:
            print("No")
    
    elif(y[i] == "b"):
        if(count_a + count_b < (A + B) and count_b < B):
            print("Yes")
            count_b += 1
        else:
            print("No")
    
    elif(y[i] == "c"):
        print("No")

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

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

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

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

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

Solution (Python):
N,A,B=map(int,input().split())
S=input()
t_count=0
b_count=0
flag=None

for i in S:
  if i=="c":
    print("No")
  else:
    if i=="a":
      t_count+=1
      if t_count<=A+B:
        print("Yes")
      else:
        print("No")
    else:
      b_count+=1
      if b_count<=B:
        t_count+=1
        if t_count<=A+B:
          print("Yes")
        else:
          print("No")
      else:
        print("No")

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

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

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

for i in range(n) :
    if s[i] == 'a' :
        if count_a + count_b < a+b :
            count_a += 1
            print('Yes')

        else :
            print('No')
        
    if s[i] == 'b' :
        if count_a + count_b < a+b and count_b < b :
            count_b += 1
            print('Yes')

        else :
            print('No')
    
    if s[i] =='c' :
        print('No')

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

oversea = 0
c = [False for i in range(n)]
cnt = 0
for i in range(n):
	if s[i] == "a":
		if cnt < a+b:
			c[i] = True
			cnt += 1
	if s[i] == "b":
		if cnt < a+b and oversea < b:
			c[i] = True
			oversea += 1
			cnt += 1
for i in c:
	if i:
		print ("Yes")
	else:
		print ("No")

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

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

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

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

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


OK=0
b_OK=0

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

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

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

cnt = 0
fcnt = 0
for i in range(N):
    s = S[i]
    if s == "c":
        print("No")
        continue
    if cnt < A + B:
        if s == "a":
            cnt += 1
            print("Yes")
        elif s == "b":
            fcnt += 1
            if fcnt <= B:
                cnt += 1
                print("Yes")
            else:
                print("No")
    else:
        print("No")

Solution (Python):
n, a, b = map(int, input().split())
s = list(input())
for i in s:
  if i == "a" and (a + b) != 0:
    a -= 1
    print("Yes")
  elif i == "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 = list(input().rstrip())

limit = A+B
cnt = 0

for s in S:
    if s=="c":
        print("No")
    elif (s=="a") & (cnt<limit):
        print("Yes")
        cnt += 1
    elif (s=="b") & (cnt<limit) & (B>0):
        print("Yes")
        cnt += 1
        B -= 1
    else:
        print("No")

Solution (Python):

import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache

readline=sys.stdin.readline
sys.setrecursionlimit(2000000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)

def main():
    N,A,B=map(int,input().split())
    S=input()
    cnt=0
    bcnt=0
    ans=[]
    for c in S:
        if c=="c":
            ans.append("No")
            continue

        if c=="a" and cnt<A+B:
            ans.append("Yes")
        elif c=="b" and bcnt<B and cnt<A+B:
            ans.append("Yes")
        else:
            ans.append("No")
            continue
        cnt+=1
        if c=="b":bcnt+=1
    for a in ans:
        print(a)


main()

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

Solution (Python):
n,a,b = map(int,input().split())
s = list(input())
cnt = 0
fcnt = 0
ans = []
for i in s:
  if i=="a":
    cnt +=1
    if cnt <=(a+b):
      ans.append("Yes")
    else:
      cnt -=1
      ans.append("No")
  if i=="b":
    cnt +=1
    fcnt +=1
    if cnt<=(a+b) and fcnt <=b:
      ans.append("Yes")
    else:
      cnt -=1
      fcnt -=1
      ans.append("No")
  if i=="c":
    ans.append("No")

for k in ans:
  print(k)

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

n_all = 0
n_for = 0
for s1 in s:
    if s1 == "a":
        if n_all < a + b:
            print("Yes")
            n_all += 1
        else:
            print("No")
    elif s1 == "b":
        if n_all < a + b and n_for < b:
            print("Yes")
            n_all += 1
            n_for += 1
        else:
            print("No")
    else:
        print("No")