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

ans_list = []
for i in range(len(s)):
    frag = False
    if s[i] == "a":
        if a > 0:
            a -= 1
            frag = True
        elif b > 0:
            b -= 1
            frag = True
    elif s[i] == "b":
        if b > 0:
            b -= 1
            frag = True
    if frag:
        ans_list.append("Yes")
    else:
        ans_list.append("No")

for i in range(len(s)):
    print(ans_list[i])

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

Solution (Python):
import sys, itertools, fractions, math, collections, heapq
sys.setrecursionlimit(10**7)
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

n, a, b = LI()
s = list(input())

aq, bq = 0, 0
for ss in s:
    if ss=='a':
        if aq + bq < a+b:
            print('Yes')
            aq+=1
        else:
            print('No')
    if ss=='b':
        if aq + bq < a+b and bq+1<=b:
            print('Yes')
            bq+=1
        else:
            print('No')
    if ss=='c':
        print('No')

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

ab = a+b

passed = 0

Bs = 1

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

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




def gcd(a, b):
    while b:
        a, b = b, a % b
    return a 
ab = A+B
b = B
for s in S:
    if s == 'a' and ab > 0:
        print('Yes')
        ab -= 1
    elif s == 'b' and ab > 0 and b > 0:
        print('Yes')
        ab -= 1
        b -= 1
    else:
        print('No')

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

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

Solution (Python):
N,A,B=[int(item)for item in input().split()]
S=input()
for c in S:
    if c == 'c':
        print("No")
    elif c == 'a':
        if A == 0:
            if B>0:
                B -= 1
                print("Yes")
            else:
                print("No")
        else :
            A-=1
            print("Yes")
    else:
        
        if B == 0:
            print("No")
        else:
            B-=1
            print("Yes")

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

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

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

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

N, A, B = int(N), int(A), int(B)

S = input().strip()

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

Solution (Python):













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

AplusB = A+B

ans = []
for i in range(len(S)):
    if S[i]=="a" and AplusB>0:
        ans.append("Yes")
        AplusB -= 1
    elif S[i]=="b" and AplusB>0 and B>0:
        ans.append("Yes")
        AplusB -= 1
        B -= 1
    else:
        ans.append("No")

print(*ans,sep="\n")

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

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

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

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

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

total = 0
kaigai = 0

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

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

N, A, B = map(int, readline().split())
S = list(str(input()))

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

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


kaigai = 0
Sankasya = 0

for i in range(1,N+1):
    if S[i-1] == "c":
        print("No")

    if S[i-1] == "a":
        if (Sankasya) < A+B:
            Sankasya = Sankasya + 1
            print("Yes")
        else:
            print("No")
    
    if S[i-1] == "b":
        kaigai = kaigai + 1
        if (Sankasya) < A+B and  B >= kaigai:
            Sankasya = Sankasya + 1
            print("Yes")
        else:
            print("No")

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

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

b_cnt = 0
a_cnt = 0
for si in s:
    if si == "c":
        print("No")
        
    elif si == "a":
        if a_cnt+b_cnt < a + b:
            print("Yes")
            a_cnt+=1
        else:
            print("No")
        
    else:
        if 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()
couab = 0
coub = 0
for i in range(n):
    if s[i] == "a":
        if couab < a+b:
            print("Yes")
            couab += 1
        else:
            print("No")
    elif s[i] == "b":
        coub += 1
        if couab < a+b and coub <= b:
            print("Yes")
            couab += 1
        else:
            print("No")
    elif s[i] == "c":
        print("No")

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

    c1 = 0
    c2 = 0

    for i in range(N):
        if c1 >= A + B:
            print('No')
            continue

        if S[i] == 'a':
            c1 += 1
            print('Yes')
        elif S[i] == 'b':
            if c2 < B:
                c1 += 1
                print('Yes')
            else:
                print('No')
            c2 += 1
        else:
            print('No')


main()

Solution (Python):
n,a,b=map(int,input().split())
s=input()
"""
10 2 3
abccabaabb
->
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No

12 5 2
cabbabaacaba
->
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
"""
n_pass=0
n_fpass=0
ans=[]
for _ in range(n):
    if s[_] == 'a' and n_pass < a+b:
        n_pass+=1
        ans.append('Yes')
    elif s[_] == 'b' and n_pass < a+b and n_fpass < b:
        n_pass+=1
        n_fpass+=1
        ans.append('Yes')
    else:
        ans.append('No')
for _ in range(n):
    print(ans[_])

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

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

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

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

sm = 0
foreign = 1

for i in S:
    if i == 'c':
        print('No')
    elif sm < A + B:
        if i == 'b':
            if foreign <= B:
                print('Yes')
                sm += 1
                foreign += 1
            else:
                print('No')
        else:
            print('Yes')
            sm += 1
    else:
        print('No')

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

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

s = input()
ct = 0
bct = 0

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

Solution (Python):
from sys import stdin
input = stdin.readline

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

a = 0
b = 0

for s in S:
    if s == "a":
        if a + b < A + B:
            a += 1
            print("Yes")
        else:
            print("No")
    elif s == "b":
        if a + b < A + 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()
y = 0
k = 0
for i in S:
    if i=='c':
        print('No')
    elif i=='a':
        if (y<(A+B)):
            print('Yes')
            y += 1
        else:
            print('No')
    else:
        if (y<(A+B))and(k<B):
            print('Yes')
            y += 1
            k += 1
        else:
            print('No')

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

domestic = 0
abroad = 0

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

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

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

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

a_passed = 0
b_passed = 0

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,a,b = inpl()
s = input()
kaku = 0
kaigai = 0
for i,t in enumerate(s):
    if t == 'a':
        if kaku < a+b:
            res = 'Yes'
            kaku += 1
        else:
            res = 'No'
    elif t == 'b':
        if kaku < a+b and kaigai < b:
            res = 'Yes'
            kaku += 1
            kaigai += 1
        else:
            res = 'No'
    else:
        res = 'No'
    print(res)

Solution (Python):
from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
S = (stdin.readline().rstrip())

AC = 0
BC = 0

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

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

count = 0
b_count = 0
for i in range(n):
    c = s[i]
    if c=='c':
        print('No')
        continue
    if c=='a':
        if a+b>count:
            count+=1
            print('Yes')
        else:
            print('No')

    if c=='b':
        if a+b>count and (b_count+1)<=b:
            count+=1
            b_count+=1
            print('Yes')
        else:
            b_count+=1
            print('No')

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

allp = A + B
qual = 0
Brank = 1

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

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

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

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

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

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

ab = 0
b = 0
y = 'Yes'
n = 'No'

for s in S:
    if s == 'a':
        if ab < A+B:
            print(y)
            ab += 1
        else:
            print(n)
    elif s == 'b':
        if ab < A+B and b < B:
            print(y)
            ab += 1
        else:
            print(n)
        b += 1
    else:
        print(n)

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

rankALL=1
rankb=1

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

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

a, b = 0, 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())
S =input()

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

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

confirmed = 0
confirmedB = 0

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

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

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

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

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

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

Solution (Python):

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

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

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

Solution (Python):
def main():
    N, A, B = (int(i) for i in input().split())
    S = input()
    c = 0
    ob = 0
    for s in S:
        if s == "a":
            if c+ob < A+B:
                c += 1
                print("Yes")
            else:
                print("No")
        elif s == "b":
            if c+ob < A+B and ob < B:
                ob += 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())
p=0
f=1
for (i,s) in enumerate(S):
    if s=="a":
        if p<A+B:
            print("Yes")
            p+=1
        else:
            print("No")
    if s=="b":
        if p<A+B and f<=B:
            print("Yes")
            f+=1
            p+=1
        else:
            print("No")
    if s=="c":
        print("No")

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

a = 0
b = 0

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

Solution (Python):



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


rank_num = 0
rank_b_num = 0


for s in S:
    if s=='a':
        if rank_num<A+B:
            print("Yes")
            rank_num += 1
        else:
            print("No")
    elif s=='c':
        print("No")
    elif s=='b':
        if rank_num<A+B and rank_b_num<B:
            print("Yes")
            rank_num += 1
            rank_b_num += 1
        else:
            print("No")

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n, a, b = MAP()
s = STR()
c = 0
d = 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 d < b:
        print('Yes')
        c += 1
        d += 1
    else:
        print('No')

Solution (Python):
n,a,b = map(int,input().split())
s = list(input())
tuka = []
ab = []
for i in s:
    if len(tuka) < (a+b):
        if i=="a":
            tuka.append(i)
            print('Yes')
        elif i=="b":
            if len(ab)<b:
                ab.append(i)
                tuka.append(i)
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

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

num = 0
num_b = 0

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

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

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

jp = 0
os = 0
for s in S:
  ans = "No"
  if jp + os < A + B:
    if s == "a":
      jp += 1
      ans = "Yes"
    if s == "b" and os < B:
      os += 1
      ans = "Yes"
  print(ans)

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

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


cur_b = 0
cur = 0

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