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 = ["*"]+list(input())

finalist = 0
foreigner_student_finalist = 0

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

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

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

Solution (Python):
import sys



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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, a, b = input_int_list()
    S = input()
    passed = 0
    oversea = 0
    for s in S:
        if s == "a" and passed < a + b:
            passed += 1
            print("Yes")
        elif s == "b" and passed < a + b and oversea < b:
            oversea += 1
            passed += 1
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
li = list(map(int,input().split()))
s=list(input())
N=li[0]
A=li[1]
B=li[2]
domPass=0
forePass=0
for x in s:
    if(x=='a'):
        if((domPass+forePass)<(A+B)):
            domPass=domPass+1
            print('Yes')
        else:
            print('No')
    elif(x=='b'):
        if(((domPass+forePass)<(A+B))and(forePass<B)):
            forePass=forePass+1
            print('Yes')
        else :
            print('No')
    elif(x=='c'):
        print('No')

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

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

Solution (Python):
def solve1(n, a, b, s):
    ans = ["No" for i in range(len(s))]

    
    

    for i in range(len(s)):
        if s[i] == "a":
            if a > 0:
                ans[i] = "Yes"
                a -= 1
            elif b > 0:
                ans[i] = "Yes"
                b -= 1
        elif s[i] == "b":
            if b > 0:
                ans[i] = "Yes"
                b -= 1

        

    return ans


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

print("\n".join(solve1(n, a, b, s)))

Solution (Python):
n,a,b = list(map(int, input().split()))
s = input()
success = 0
success_b = 0
for S in s:
    if S == 'a' and success < a + b:
        print('Yes')
        success += 1
    elif S == 'b' and success < a + b and success_b < b:
        print('Yes')
        success += 1
        success_b += 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:
    print("Yes")
    a += 1
  elif S[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=input().strip()
njp=0
nop=0
for i in range(len(s)):
  if s[i]=='a':
    if njp<(a+b):
      njp+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if njp<(a+b):
      if nop<b:
        nop+=1
        njp+=1
        print('Yes')
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')

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

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

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

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

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

Solution (Python):
n,a,b=map(int,input().split())
for c in input():
  f=1
  if c<"b"and a+b>0:f=0;a-=1
  elif c<"c"and a+b>0and b>0:f=0;b-=1
  print("YNeos"[f::2])

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

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

allcnt=0
b_cnt=0

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

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

Solution (Python):
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

n, a, b = LI()
s = S()










sl = list(s)
list_a = []
list_b = []
max_pass = a + b

for i in range(len(sl)):
    if sl[i] == "a":
        if len(list_a) + len(list_b) < max_pass:
            sl[i] = "Yes"
            list_a.append(i)
        else:
            sl[i] = "No"
    elif sl[i] == "b":
        if len(list_a) + len(list_b) < max_pass and len(list_b) < b:
            sl[i] = "Yes"
            list_b.append(i)
        else:
            sl[i] = "No"
    elif sl[i] == "c":
        sl[i] = "No"

for x in sl:
    print(x)

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

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

Solution (Python):
n, a, b = map(int, input().split())
s = input()
jap_c = 0
ab_c = 0
for i in list(s):
    if i == 'a':
        if jap_c + ab_c < a+b:
            jap_c += 1
            print('Yes')
            continue
    if i == 'b':
        if jap_c + ab_c < a+b:
            if ab_c < b:
                ab_c += 1
                print('Yes')
                continue
    print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = list(input())
line = a + b
rank = 1
bnum = 0
for student in s:
    if student == "a" or student== "b":
        if rank <= line:

            if student == "a":
                print("Yes")
                rank += 1
            else:
                bnum += 1
                if bnum <= b:
                    print("Yes")
                    rank += 1
                else:
                    print("No")
        else:
            print("No")
    else:
        
        print("No")

Solution (Python):
n, a, b = map(int, input().split())  
sList = input()
cnt = 0
cnt_b = 0
for i, s in enumerate(sList):
    if s == 'a':
        
        if cnt < a+b:
            cnt += 1
            print('Yes')
        else:
            print('No')
    elif s == 'b':
        
        if (cnt < a+b) & (cnt_b < b):
            cnt += 1
            cnt_b += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

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

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

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

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

Solution (Python):


N, A, B = map(int, input().split())
S = input()
cur_rank = 1
world_cur_rank = 1

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

Solution (Python):
n ,a, b  =map(int, input().split())
S = list(input())
threshold = a + b
rank = 1
bnum = 1
for p in S:
    if p == "a" or p == "b":
        if rank <= threshold:
            if p == "b" and bnum <= b:
                print("Yes")
                bnum += 1
                rank += 1
            elif p == "b" and bnum > b:
                print("No")
                bnum += 1
            else:
                print("Yes")
                rank += 1
        else:
            print("No")
    else:
        print("No")

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

for s in S:
  if s == "c":
    print("No")
  elif s == "a":
    if A + B == 0:
   	  print("No")
    else:
      A -= 1
      print("Yes")
  elif s == "b":
    if A + B == 0 or B == 0:
      print("No")
    else:
      B -= 1
      print("Yes")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, A: int, B: int, S: str):
    at = 0
    bt = 0
    for s in list(S):
        if s == "c":
            print(NO)
            continue
        if at + bt < A + B:
            if s == "a":
                print(YES)
                at += 1
            elif s == "b" and bt < B:
                print(YES)
                bt += 1
            else:
                print(NO)
        else:
            print(NO)

    return



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):
def check_jp(passed, A, B):
    return passed < A + B


def check_foreign(passed, A, B, passed_b):
    return passed < A + B and passed_b < B


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

    passed = 0
    passed_b = 0
    for i, p in enumerate(S):
        if p == "a":
            if check_jp(passed, A, B):
                print("Yes")
                passed += 1
            else:
                print("No")
        elif p == "b":
            if check_foreign(passed, A, B, passed_b):
                print("Yes")
                passed += 1
                passed_b += 1
            else:
                print("No")
        else:
            print("No")

resolve()

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

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

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

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())
ans = ""
cnt = 0
f = 0

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

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

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

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

Solution (Python):
import sys
a = [int(c) for c in input().split()]
N = a[0]
A = a[1]
B = a[2]
S = input()

cnt = 0
f = 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 f+1 <= B:
            print("Yes")
            cnt+=1
            f+=1
        else:
            print("No")
        pass
    elif S[i] == "c":
        print("No")

Solution (Python):


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

    for c in S:
        if c == 'c':
            ans = 'No'
        elif c == 'a':
            if A + B > cnt:
                ans = 'Yes'
                cnt += 1
            else:
                ans = 'No'
        else:
            if A + B > cnt and B > cnt_f:
                ans = 'Yes'
                cnt += 1
                cnt_f += 1
            else:
                ans = 'No'
        print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n, a, b = map(int, input().split())
    s = input()
    foreign, passed = 0, 0

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


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):

import sys
input=sys.stdin.readline

def main():
    candidates=[]
    n,a,b = map(int,input().split())
    [candidates.append(s) for s in input().rstrip()]
    limit=a+b
    b_counter=1

    for idx in range(1,len(candidates)+1):
        if 'a' in candidates[idx-1] and limit > 0:
            limit-=1
            print("Yes")
        elif 'b' in candidates[idx-1] and limit > 0 and b_counter <= b:
            b_counter+=1
            limit-=1
            print("Yes")
        else:
            print("No")
    
if __name__=="__main__":
    main()

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

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

a_reviewed = 0
b_reviewed = 0

for x in s:
    if a_reviewed + b_reviewed < a + b:
        if x == 'a':
            print('Yes')
            a_reviewed += 1
        elif x == 'b' and b_reviewed < b:
            print('Yes')
            b_reviewed += 1
        else:
            print('No')
    else:
        print('No')

Solution (Python):

N,A,B = map(int,input().split())
S = input()
domestic,foreign = 0,0

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

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

p=0
q=0

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

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

passed_count = 0
passed_count_foreigner = 0

for person in s:
    if passed_count < a + b and person == "a":
        print("Yes")
        passed_count += 1
    elif passed_count < a + b and person == "b" and passed_count_foreigner < b:
        print("Yes")
        passed_count += 1
        passed_count_foreigner += 1
    else:
        print("No")

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    for char in S:
        flag = False
        if char == "a":
            if cnt_a + cnt_b < A + B:
                cnt_a += 1
                flag = True
        elif char == "b":
            if cnt_a + cnt_b < A + B:
                if cnt_b < B:
                    cnt_b += 1
                    flag = True
        print("Yes" if flag else "No")


if __name__ == '__main__':
    main()

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

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

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

for i in range(N):
  s=S[i]
  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())
S = input()

t1,t2 = 0,0
for ch in S:
  if ch == "c":
    print("No")
  elif ch == "a":
    if t1 >= A+B:
      print("No")
    else:
      t1 += 1
      print("Yes")
  else:
    if t1 >= A+B or t2 >= B:
      print("No")
    else:
      t1 += 1
      t2 += 1
      print("Yes")

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

count = 0
count_B = 0

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

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

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

Solution (Python):

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

thr_dom = a+b
thr_nat = b
pass_num = 0
pass_nat = 0

for member in member_list:
    if member == 'a':
        if pass_num < thr_dom:
            print("Yes")
            pass_num += 1
        else:
            print("No")
    elif member == "b":
        if pass_num < thr_dom and pass_nat < thr_nat:
            print("Yes")
            pass_num += 1
            pass_nat += 1
        else:
            print("No")
    else:
        print("No")

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

passed = 0
limit = a+b
b_rank = 1

ans_list = []
for w in s:
    if w == 'a':
        if passed < limit:
            ans_list.append('Yes')
            passed += 1
        else:
            ans_list.append('No')
    elif w == 'b':
        if passed < limit and b_rank <= b:
            ans_list.append('Yes')
            passed += 1
        else:
            ans_list.append('No')
        b_rank += 1
    else:
        ans_list.append('No')

for i in ans_list:
    print(i)

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


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

Solution (Python):
a = input("").split(" ")
a = [int(b) for b in a]
N = a[0]
A = a[1]
B = a[2]
S = input("")
n = 0
nb = 1
for c in range(len(S)):
    if S[c] == "a":
        if n < (A + B):
            n += 1
            print("Yes")
        else:
            print("No")
    elif S[c] == "b":
        if n < (A + B) and nb <= B:
            n += 1
            nb += 1
            print("Yes")
        else:
            print("No")
    elif S[c] == "c":
        print("No")

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

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

Solution (Python):
N, A, B = map(int, input().split())
S = input()
student_pass = A + B
abroad_student_pass = B
passed_students = 0
passed_students_abroad = 0


for status in S:
  if status == 'c':
    print('No')
  elif status == 'a':
    if passed_students < student_pass:
      print('Yes')
      passed_students += 1
    else:
      print('No')
  elif status == 'b':
    if passed_students < student_pass and passed_students_abroad < abroad_student_pass:
      print('Yes')
      passed_students += 1
      passed_students_abroad += 1
    else:
      print('No')

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n, a, b = i_list()
    ss = s_input()

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

if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin
from math import ceil, floor
n,a,b=[int(x) for x in stdin.readline().rstrip().split()]
s=list(stdin.readline().rstrip())
c=a+b
d=e=m=0
for i in range(n):
    if d<c and s[i]=="a":
        print("Yes")
        d+=1
    elif d<c and e<b and s[i]=="b":
        print("Yes")
        d+=1
        e+=1
    else:
        print("No")
    if d>=c:
        m=i+1
        break
if m != 0:
    for i in range(n-m):
        print("No")

Solution (Python):
from sys import stdin
from math import ceil, floor
n,a,b = [int(x) for x in stdin.readline().rstrip().split()]
s=list(stdin.readline().rstrip())
c=a+b
d=e=0
for i in range(n):
    if d<c and s[i]=="a":
        print("Yes")
        d+=1
    elif d<c and e<b and s[i]=="b":
        print("Yes")
        d+=1
        e+=1
    else:
        print("No")

Solution (Python):
from sys import stdin
from math import ceil, floor
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
s = list(stdin.readline().rstrip())
d = 0
e = 0
for i in range(n):
    if d < a + b and s[i] == "a":
        print("Yes")
        d += 1
    elif d < a + b and e < b and s[i] == "b":
        print("Yes")
        d += 1
        e += 1
    else:
        print("No")

Solution (Python):
from sys import stdin
from math import ceil, floor
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
s = list(stdin.readline().rstrip())
c = a + b
d = 0
e = 0
for i in range(n):
    if d < c and s[i] == "a":
        print("Yes")
        d += 1
    elif d < c and e < b and s[i] == "b":
        print("Yes")
        d += 1
        e += 1
    else:
        print("No")