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):
def II(): return int(input())
def MI(): return map(int,input().split())
def LMI(): return list(map(int,input().split()))
def LIIN(n): return list(int(input()) for _ in range(n))
def LMIN(n): return [list(map(int, input().split())) for _ in range(n)]
def IS(): return input()
def LS(): return list(input())
def MS(): return map(str,input().split())
def LMS(): return list(map(str,input().split()))
def LMS(): return list(map(str,input().split()))
def LISN(n): return list(input() for _ in range(n))
def LMSN(n): return [input().split() for _ in range(n)]
MOD = 10**9+7
INF = 10**18

def main():
    n,a,b = MI()
    s = LS()
    for i in range(n):
        if s[i] == 'c':
            print('No')
            continue
        if s[i] == 'a':
            if a > 0:
                a-=1
                print('Yes')
            elif b > 0:
                b-=1
                print('Yes')
            else:
                print('No')
            continue
        if s[i] == 'b':
            if a+b > 0 and b > 0:
                b-=1
                print('Yes')
            else:
                print('No')
            continue

if __name__ == '__main__':
    main()

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

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

count, rank = 0, 0
for s in S:
    if s == 'b':
        rank += 1

    if (s == 'a') and (count < A + B):
        count += 1
        print('Yes')
    elif (s == 'b') and (count < A + B) and (rank <= B):
        count += 1
        print('Yes')
    else:
        print('No')

Solution (Python):
N,A,B=map(int,input().split())
s=input()
cnt=0
sum_b=0

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

Solution (Python):
N, A, B = map(int, input().split())
s = input()
 
x, y = 0, 0
for i, p in enumerate(s):
    if p=="a":
        if x < A+B:
            print("Yes")
            x+=1
        else:
            print("No")
    elif p=="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()

pass_a = True
cnt = 0
cnt_b = 1
for i in s:

    if cnt < A + B:
        if i == "a":
            print("Yes")
            cnt += 1

        elif i == "b":
            if cnt_b <= B:
                print("Yes")
                cnt += 1
                cnt_b += 1
            else:
                print("No")
        else:
            print("No")
    
    else:
        print("No")

Solution (Python):
vars = input().split()
n,a,b = int(vars[0]),int(vars[1]),int(vars[2])
passed = 0
os = 1
parts = input()
for c in parts:
  if c=="c":
    print("No")
  elif c=="b" and passed<a+b and os<=b:
    print("Yes")
    passed += 1
    os += 1
  elif c=="a" and passed<a+b:
    print("Yes")
    passed += 1
  else:
    print("No")

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

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

b_cnt = 0
ab_cnt = 0
for i in s:
    if i == "a":
        if ab_cnt < a + b:
            ab_cnt += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        if ab_cnt < a + b and b_cnt < b:
            ab_cnt += 1
            b_cnt += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left



def main():
    n, a, b = MII()
    s = IS()
    maxv = a+b
    now = 0
    e_now = 0
    for si in s:
        if si == 'a':
            if now < maxv:
                print('Yes')
                now += 1
                continue
        elif si == 'b':
            if now < maxv and e_now < b:
                print('Yes')
                now += 1
                e_now += 1
                continue
        print('No')

if __name__ == '__main__':
    main()

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

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

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

countA = 0
countB = 0
count = 0

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

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

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

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

def ans(b):
  print('Yes' if b else 'No')

passed = 0 
overseas = 0 


for s in S:
  if s == 'a':
    if passed < A + B:
      passed += 1
      ans(1)
    else:
      ans(0)
  elif s == 'b':
    overseas += 1
    if passed < A + B and overseas <= B:
      passed += 1
      ans(1)
    else:
      ans(0)
  else:
    ans(0)

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

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

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

tuuka = 0
kaigai = 0

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

Solution (Python):

N, A, B = [int(s) for s in input().split()]
S = input()

domestics = 0
abroads = 0

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

Solution (Python):
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

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

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

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

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

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

Solution (Python):

N, A, B = map(int, input().split())
students = list(input())
through = 0
abroad_rank = 0
for student in students:
    if through >= A+B:
        print('No')
        continue
    if student == 'a':
        print('Yes')
        through += 1
    elif student == 'b':
        if abroad_rank+1<=B:
            print('Yes')
            through += 1
            abroad_rank += 1
        else:
            print('No')
    else:
        print('No')

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

Solution (Python):
import sys
input=sys.stdin.buffer.readline
n,a,b=map(int,input().split())
S=input()[:-1]
total=0
b_lim=0
for i in range(n):
    if S[i]==97 and total<a+b:
        print("Yes")
        total+=1
        continue
    if S[i]==98 and total<a+b and b_lim<b:
        print("Yes")
        total+=1
        b_lim+=1
        continue
    else:print("No")

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

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

a_counter = 0
b_counter = 0

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

Solution (Python):
n,a,b = map(int,input().split())
s = list(input())
x = a + b
xb = b
for i in range(n):
    if s[i] == "c" or x == 0:
        print("No")
    else:
        if s[i] == "b":
            if xb == 0:
                print("No")
            else:
                print("Yes")
                x -= 1
                xb -= 1
        else:
            print("Yes")
            x -= 1

Solution (Python):
n,nai,out=map(int,input().split())
b=input()
kokunai=0
kaigai=0
for i in range(n):
  if(b[i]=='c'):
    print('No')
  elif(b[i]=='a'):
    if(kokunai+kaigai>=nai+out):
      print('No')
    else:
      kokunai=kokunai+1
      print('Yes')
  else:
    if(kokunai+kaigai>=nai+out or kaigai>=out):
      print('No')
    else:
      print('Yes')
      kaigai=kaigai+1

Solution (Python):
N, A, B = tuple(map(int, input().split()))
S = input()
cutline = A + B
qualified = 0
foreigner = 0

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

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

Solution (Python):
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, A, B = input_number_list()
    S = input()
    total = 0
    total_f = 0
    for c in S[:-1]:
        isNg = False
        if c == 'a' and total < A + B:
            total += 1
        elif c == 'b' and total < A + B and total_f < B:
            total += 1
            total_f += 1
        else:
            isNg = True
        print('YNeos'[isNg::2])


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, A, B = MAP()
S = input()
f = 0
passed = 0
for i, s in enumerate(S):
	if s == "b":
		f += 1
	if s == "a" and passed < A+B:
		print("Yes")
		passed += 1
	elif s == "b" and passed < A+B and f <= B:
		print("Yes")
		passed += 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]=="c":
        print("No")
    elif 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+1<=B:
            print("Yes")
            b+=1
        else:
            print("No")

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

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

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

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

def main():
    n, a, b = map(int, input().split())
    s = input()

    c_all = 0
    c_b = 0

    for i in range(n):
        if s[i] == 'c' or c_all >= a+b:
            print('No')
        elif s[i] == 'a':
            c_all += 1
            print('Yes')
        elif s[i] == 'b' and c_b < b:
            c_all += 1
            c_b += 1
            print('Yes')
        else:
            print('No')


if __name__ == '__main__':
    main()

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

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

    elif s[i] == 'b':
        b = b - 1
        if b >= 0:
            a_b = a_b - 1
            if a_b >= 0:
                print('Yes')
            else:
                print('No')
        else:
            print('No')

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

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

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

all_cnt, for_cnt = 0, 0
for i in s:
    if i == 'a':
        if all_cnt < a+b:
            print('Yes')
            all_cnt += 1
        else:
            print('No')
    elif i == 'b':
        if all_cnt < a+b:
            if for_cnt < b:
                print('Yes')
                all_cnt += 1
                for_cnt += 1
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

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

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

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

for s in S:
    if M <= 0:
        print("No")
    elif s == "a":
        print("Yes")
        M -= 1
    elif s == "b":
        if B <= 0:
            print("No")
        else:
            print("Yes")
            M -= 1
            B -= 1
    else:
        print("No")

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

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

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

Solution (Python):
from statistics import median


from itertools import combinations 
from collections import deque
from collections import defaultdict
from fractions import gcd
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,a,b = readInts()
    S = input()
    ab = a + b
    passed = 0
    ovs = 1
    for i in range(n):
        if S[i] == 'a':
            if passed < ab:
                print('Yes')
                passed += 1
            else:
                print('No')
        if S[i] == 'b':
            if passed < ab and ovs <= b:
                print('Yes')
                passed += 1
                ovs += 1
            else:
                print('No')
        if S[i] == 'c':
            print('No')

if __name__ == '__main__':
  main()

Solution (Python):
n,A,B=map(int,input().split())
s=list(input())
cnt=0
cnt_b=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_b<B:
		print('Yes')
		cnt_b+=1
		cnt+=1
	else:
		print('No')

Solution (Python):
row = input().split(' ')
n = int(row[0])
a = int(row[1])
b = int(row[2])
s = input()
passed_kokunai = 0
passed_kaigai = 0
ans = list()
for i, ch in enumerate(s):
    if passed_kokunai + passed_kaigai >= a + b:
        ans.append('No')
        continue
    if ch == 'a':
        ans.append('Yes')
        passed_kokunai += 1
    elif ch == 'b' and passed_kaigai < b:
        ans.append('Yes')
        passed_kaigai += 1
    else:
        ans.append('No')
for elem in ans:
    print(elem)

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

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

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

for F in f:
  print(F)

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

ab = a + b
cnt = 0
fcnt = 1
for i in range(n):
    if s[i] == 'a' and ab > cnt:
        cnt += 1
        print('Yes')
    elif s[i] == 'b' and (ab > cnt and b >= fcnt):
        cnt += 1
        fcnt += 1
        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):
def resolve():
    n,a,b=map(int, input().split())
    s=list(input())
    cnt=0
    cnt_b=0
    for i in range(n):
        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')
resolve()

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

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

passed_japanese = 0
passed_foreigner = 0
ans = []

for i, c in enumerate(S):
    if A+B > passed_japanese+passed_foreigner:
        if c == 'a':
            passed_japanese += 1
            ans.append('Yes')
        elif c == 'b':
            if passed_foreigner+1 <= B:
                passed_foreigner += 1
                ans.append('Yes')
            else:
                ans.append('No')
        else:
            ans.append('No')
    else:
        ans.append('No')

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

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

total = a + b
foreign = b

for c in s:
    if total <= 0:
        print('No')
    else:
        
        if c == 'c':
            print('No')
        elif c == 'a':
            print('Yes')
            total -= 1
        elif foreign <= 0:
            print('No')
        else:
            print('Yes')
            total -= 1
            foreign -= 1

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

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

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

passed_foreigner = 0
passed_native = 0

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, a, b = map(int, input().split())
    S = input()

    cnt = 0
    cnt_b = 0
    for s in S:
        if cnt < a + b:
            if s == "a":
                print("Yes")
                cnt += 1
            elif s == "b":
                if cnt_b < b:
                    print("Yes")
                    cnt += 1
                    cnt_b += 1
                else:
                    print("No")
            else:
                print("No")
        else:
            print("No")


if __name__ == '__main__':
    resolve()

Solution (Python):
l=list(map(int,input().split()))
participant=list(input())
passnum=l[1]+l[2]
b=0
for i in range(l[0]):
    if participant[i]=='a' and passnum>0:
        participant[i]='Yes'
        passnum-=1
    elif participant[i]=='b' and passnum>0 and b<l[2]:
            participant[i]='Yes'
            passnum-=1
            b+=1
    elif passnum==0:
        break
for i in range(l[0]):
    if participant[i]!='Yes':
        participant[i]='No'
for i in range(l[0]):
    print(participant[i])

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):


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