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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**10
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N,A,B = LI()
    s = S()
    a = b = 0
    r = []
    for c in s:
        if c == 'a' and a+b < A+B:
            r.append('Yes')
            a += 1
        elif c == 'b' and a+b < A+B and b<B:
            r.append('Yes')
            b += 1
        else:
            r.append('No')
    return '\n'.join(r)


print(main())

Solution (Python):
line = input().split()
N = int(line[0])
A = int(line[1])
B = int(line[2])
S = input()

ab = 0
bb = 0
for c in S:
    b = False
    if c == 'a' and ab < A + B:
        b = True
        ab += 1
    elif c == 'b' and ab < A + B and bb < B:
        b = True
        ab += 1
        bb += 1
    print("Yes" if b else "No")

Solution (Python):
n,a,b=map(int,input().split())
s=input()
p=q=0
v=[]
for c in s:
    if c == 'a':
        v.append(p < a+b)
        if p < a+b:
            p += 1
    elif c == 'b':
        v.append(p < a+b and q < b)
        if p < a+b and q < b:
            p += 1
            q += 1
    else:
        v.append(False)
for x in v:
    print('Yes' if x else 'No')

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

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

winner=0
ab_winner=0
return_list=[]

for i in range(N):
    if S[i]=='a':
        if winner<A+B:
            return_list.append('Yes')
            winner+=1
        else:
            return_list.append('No')
            
    elif S[i]=='b':
        if winner<A+B:
            if ab_winner<B:
                return_list.append('Yes')
                winner+=1
                ab_winner+=1
            else:
                return_list.append('No')
        else:
            return_list.append('No')
    else:
        return_list.append('No')

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

Solution (Python):
NAB = map(int, raw_input().split())
N = NAB[0]
A = NAB[1]
B = NAB[2]
S = raw_input()
passed_student = 0
foreign_student_rank = 0

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

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

Solution (Python):
import os
import sys
import numpy as np


def dump(x):
    print >> sys.stderr, "{0}".format(x)

l = map(int, raw_input().split())
S = raw_input()
AB = l[1]+l[2]
B = l[2]
N = l[0]

count_array = [0]*2
pass_list = [0]*N
for i, s in enumerate(S):
    if count_array[0] >= AB:
        break

    if s == "a":
        count_array[0] += 1
        pass_list[i] = 1
    elif s == "b" and count_array[1] < B:
        count_array[0] += 1
        count_array[1] += 1
        pass_list[i] = 1

for pass_ in pass_list:
    if pass_ == 1:
        print("Yes")
    else:
        print("No")

Solution (Python):
import bisect
import sys
import math
import itertools
sys.setrecursionlimit(10000)

INF = float('inf')


def i():
    return int(raw_input())
def ii():
    return map(int,raw_input().split(" "))
def s():
    return raw_input()
def ss():
    return raw_input().split(" ")
def slist():
    return list(raw_input())


def join(s):
    return ''.join(s)


def piter(n,m):
    return itertools.permutations(n,m)
def citer(n,m):
    return itertools.combinations(n,m)


def modc(a,b,m):
    c = 1
    for i in xrange(b):
        c = c * (a - i) % m
        c = c * modinv(i + 1,m) % m
    return c
 
def gcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)
 
def modinv(a, m):
    (inv, q, gcd_val) = gcd(a, m)
    return inv % m


def index(a, x):
    
    i = bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return i
    return -1


def memoize(f):
    cache = {}
    def helper(*args):
        if args not in cache:
            cache[(args)] = f(*args)
        return cache[args]
    return helper

@memoize
def nck(a,b,m):
    b = min([a-b,b])
    if (b>a or b<0 or a<0):
        return 0
    elif a == 0:
        return 1
    return (nck(a-1,b-1,m)+nck(a-1,b,m)) % m

nh=zip([1,0,-1,0],[0,1,0,-1])



n,a,b=ii()
c=a+b
s=slist()
ans=['' for j in range(n)]
ps=0
fr=0
for j in range(n):
    if s[j]=='a':
        if ps<c:
            ps+=1
            print "Yes"
        else:
            print "No"
    elif s[j]=='b':
        if ps<c and fr<b:
            ps+=1
            fr+=1
            print "Yes"
        else:
            print "No"
    else:
        print "No"

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

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

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

Solution (Python):



from __future__ import division, print_function, absolute_import, unicode_literals

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

cb = 0
c = A + B
cnt = 0
for index, s in enumerate(S, 1):
    if s == 'c':
        print("No")
        continue
    if s == 'a':
        if cnt < c:
            print("Yes")
            cnt += 1
        else:
            print("No")
    elif s == 'b':
        cb += 1
        if cnt < c and cb <= B:
            print("Yes")
            cnt += 1
        else:
            print("No")

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

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

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

passed_a, passed_b = 0, 0
for par in par_list:
    if (passed_a+passed_b) < (a+b):
        if par == 'a':
            passed_a += 1
            print('Yes')
        elif par == 'b' and passed_b < b:
            passed_b += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Solution (Python):
init_input=map(int, raw_input().split())

mem=raw_input()
mem_list=list(mem)

man=init_input[0]
jap=init_input[1]
ove=init_input[2]

jas=0
ovs=0

for i in range(man):
    if mem[i]=="a" and jas+ovs<jap+ove:
        jas+=1
        print "Yes"
    elif mem[i]=="b" and jas+ovs<jap+ove and ovs<ove:
        ovs+=1
        print "Yes"
    else:
        print "No"

Solution (Python):
data = list(map(int,input().split()))
N = data[0]
A = data[1]
B = data[2]
S = input()

passing = 0 

foreigner = 0 

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

    elif S[i] == 'b':
        if passing < A+B and foreigner < B:
            print("Yes")
            passing += 1
            foreigner += 1
        else:
            print("No")

    else:
        print("No")

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

A_sum = 0
B_sum = 0

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

Solution (Python):
l = input().split()
s = input()
 
n = int(l[0])
a = int(l[1])
b = int(l[2])
 
count = 0
countt = 0
for i in s:
    if i == 'a':
        if count < a+b:
            count = count + 1
            print('Yes')
        else:
            print('No')
    if i == 'b':
        if (count < a+b) and (countt < b):
            count = count + 1
            countt = countt + 1
            print('Yes')
        else:
            print('No')
    if i == 'c':
        print('No')

Solution (Python):


N, A, B = map(int, input().split())
S = input()
through = 0
oversee_thr = 0
for i in range(N):
    if S[i] == "c":
        if i + 1 == N:
            print("No", end="")
        else:
            print("No")
    elif S[i] == "a":
        if through < A + B:
            if i + 1 == N:
                print("Yes", end="")
            else:
                print("Yes")
                through += 1
        else:
            if i + 1 == N:
                print("No", end="")
            else:
                print("No")
    elif S[i] == "b":
        if through < A + B and oversee_thr < B:
            if i + 1 == N:
                print("Yes", end="")
            else:
                print("Yes")
                through += 1
                oversee_thr += 1
        else:
            if i + 1 == N:
                print("No", end="")
            else:
                print("No")

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

Solution (Python):
n,a,b=map(int,raw_input().split())
ab=a+b
s=list(raw_input())
p=0
r=[]
ro=0
for i in range(n):
    if s[i]=="a" and p<ab:
        r.append("Yes")
        p+=1
    elif s[i]=="b" and p<ab and ro<b:
        ro+=1
        p+=1
        r.append("Yes")
    elif s[i]=="c":
        r.append("No")
    else:
        r.append("No")
for i in range(n):
    print(r[i])

Solution (Python):



N, A, B = (map(int, input().split(' ')))
S = input()
Nc = 0
Ac = 0
Bc = 0

for s in S:
    if s is 'a':
        Ac += 1
        if Ac+Bc <= A+B:
            print('Yes')
        else:
            print('No')
            Ac -= 1

    elif s is 'b':
        Bc += 1
        if Ac+Bc <= A+B and Bc <= B:
            print('Yes')
        else:
            print('No')
            Bc -= 1
    else:
        print('No')

Solution (Python):
nums = list(map(int, input().split()))
s=input()


N=nums[0]
A=nums[1]
B=nums[2]
cA=0
cB=0
for i in range(N):
	if(s[i:i+1] == "a"):

		if((cA+cB)<(A+B)):
			print("Yes")
			cA+=1
		else:
			print("No")
	elif(s[i:i+1]=="b"):

		if((cA+cB)<(A+B)):
			if(cB<B):
				print("Yes")
				cB+=1
			else:
				print("No")
		else:
			print("No")	
		
	elif(s[i:i+1]=="c"):
		print("No")

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

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

Solution (Python):
n, a, b = map(int, input().split())
s = str(input())
i = 0
ab = a + b
pas, bn = 0, 0
while i < n:
    if (s[i] == 'a' and pas < ab):
        print('Yes')
        pas += 1
    elif (s[i] == 'b' and pas < ab and bn < b):
        print('Yes')
        pas += 1
        bn += 1
    else:
        print('No')
    i += 1

Solution (Python):
def string_trnase(N, A, B, s):
    passed = 0
    oversea = 0
    for i in range(0, len(s)):
        if passed == A + B:
            print('No')
        elif s[i] == 'c':
            print('No')
            continue
        elif s[i] == 'a':
            if passed < A+B:
                print('Yes')
                passed += 1
        elif s[i] == 'b':
            if passed < A+B and oversea < B:
                print('Yes')
                passed += 1
                oversea += 1
            else:
                print('No')
        else:
            print('No')



nums = input()
N = int(nums.split(' ')[0])
A = int(nums.split(' ')[1])
B = int(nums.split(' ')[2])
string_trnase(N, A, B, input())

Solution (Python):



n,a,b = input().split(' ')
s = input()

n = int(n)
a = int(a)
b = int(b)

rF = 0
ok = 0

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

Solution (Python):


stdin = raw_input()
strs = stdin.split()
N = int(strs[0])
A = int(strs[1])
B = int(strs[2])
stdin2 = raw_input()

winners = 1
f_order = 1
for s in stdin2:
    if s == 'a':
        if winners <= A + B:
          print 'Yes'
          winners = winners + 1
        else:
          print 'No'
    elif s =='b':
        if winners <= A + B and f_order <= B:
          print 'Yes'
          winners = winners + 1
        else:
          print 'No'
        f_order = f_order + 1
    else:
          print 'No'

Solution (Python):
inputs = input().split()

N = int(inputs[0]) 
A = int(inputs[1])
B = int(inputs[2])

S = input()






num_passes = 0
num_jap_students = 0
num_overseas_students = 0
num_ineligible = 0

for rank in range(N):
    curr = S[rank]
    if curr == 'c':
        print('No')
        num_ineligible += 1
        continue
    if curr == 'a': 
        if num_passes < A + B: 
            print('Yes')
            num_passes += 1
        else:
            print('No')
        num_jap_students += 1
    elif curr == 'b':
        
        if num_passes < A + B and num_overseas_students + 1 <= B:
            print('Yes')
            num_passes += 1
        else:
            print('No')
        num_overseas_students += 1

Solution (Python):








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

yes = "Yes"
no = "No"

nai = 0
gai = 0
for c in s:
	if c == 'a':
		if nai + gai < A + B:
			print(yes)
			nai += 1
		else:
			print(no)
	elif c == 'b':
		if nai + gai < A + B and gai < B:
			print(yes)
			gai += 1
		else:
			print(no)
	else:
		print(no)

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

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

Solution (Python):

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

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

Solution (Python):
N,A,B=map(int,input().split())
S=str(input())
ac=0
bc=0
for i in range(N):
    if S[i]=='c':
        print('No')
    elif S[i]=='a':

        if ac+bc <A+B:
            ac +=1
            print('Yes')
        else:
            print('No')
    else:

        if bc<B and ac+bc<A+B:
            print('Yes')
            bc += 1
        else:
            print('No')

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

num_passed = 0
num_passed_overseas = 0

for student in attrs:
    if student == 'a':
        if num_passed < a + b:
            print('Yes')
            num_passed += 1
        else:
            print('No')
    elif student == 'b':
        if num_passed < a + b and num_passed_overseas < b:
            print('Yes')
            num_passed += 1
            num_passed_overseas += 1
        else:
            print('No')
    elif student == 'c':
        print('No')

Solution (Python):
N, A, B = map(int, raw_input().split())
S = raw_input()
acc_b = 0
acc_t = 0
for x in range(N):
    app = S[x]
    under = (acc_t < (A + B))
    if app == "a" and under:
        print "Yes"
        acc_t += 1
    elif app == "b" and acc_b < B and under:
        print "Yes"
        acc_t += 1
        acc_b += 1
    else:
        print "No"

Solution (Python):
args = input().split()
N = int(args[0])
A = int(args[1])
B = int(args[2])
s = input()

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

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

A, B = int(A), int(B)
count1 = 0
count2 = 1
for s in rank:
    if (s == 'a') and (count1 < A+B):
        print("Yes")
        count1 += 1
    elif (s == 'b') and (count1 < A+B) and (count2 < B+1):
        print("Yes")
        count1 += 1
        count2 += 1
    else:
        print("No")

Solution (Python):




"""









"""

def read_value():
    first_line = input()
    status = first_line.split(" ")

    num_of_contestant = int(status[0])
    basis = int(status[1])
    oversea_limit = int(status[2])

    second_line = input()
    rank_str = second_line

    return [num_of_contestant, basis, oversea_limit, rank_str]


def check_japan(rank, basis, oversea_limit):
    if rank < basis + oversea_limit:
        return "Yes"
    else:
        return "No"

def check_overseas(rank, oversea_rank, basis, oversea_limit):
    if rank < basis + oversea_limit and oversea_rank <= oversea_limit:
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":
    input_items = read_value()

    basis = input_items[1]
    oversea_limit = input_items[2]
    rank_str = input_items[3]

    oversea_rank = 0
    passed = 0

    for rank, type in enumerate(rank_str):
        if type == "a":
            if check_japan(passed, basis, oversea_limit) == "Yes":
                print("Yes")
                passed += 1
            else:
                print("No")

        if type == "b":
            oversea_rank += 1
            if check_overseas(passed, oversea_rank, basis, oversea_limit) == "Yes":
                print("Yes")
                passed += 1
            else:
                print("No")

        if type == "c":
            print("No")

Solution (Python):
N, A, B = map(int, raw_input().split())
S = raw_input()
pass_conf = []
abroad = []
for s in S:
    if s == 'c':
        print 'No'
        continue
    if len(pass_conf) < A+B:
        if s == 'a':
            pass_conf.append(s)
            print 'Yes'
        elif s == 'b':
            if len(abroad) < B:
                pass_conf.append(s)
                abroad.append(s)
                print 'Yes'
            else:
                print 'No'
        else:
            print 'No'
    else:
        print 'No'

Solution (Python):
data=map(int,raw_input().split())
l=raw_input()
rank=0
ran=0
for i in range(len(l)):
    if(l[i]=="a" and ran<data[1]+data[2]):
        print "Yes"
        ran+=1
    elif(l[i]=="b" and ran<data[1]+data[2] and rank<data[2]):
        print "Yes"
        rank+=1
        ran+=1
    else:
        print "No"

Solution (Python):


_, a, b = map(lambda s:int(s), raw_input().split())
ss = raw_input()

addmission_a = 0
addmission_b = 0

for s in ss:
    if s == 'a':
        if addmission_a + addmission_b < a + b:
            print "Yes"
            addmission_a += 1
        else:
            print "No"

    if s == 'b':
        if addmission_a + addmission_b < a + b and addmission_b < b:
            print "Yes"
            addmission_b += 1
        else:
            print "No"

    if s == 'c':
        print "No"

Solution (Python):
N, a, b = map(int, raw_input().split())
S = raw_input()
count = 0
count_b = 1
max = a + b

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

Solution (Python):

input_line_1 = raw_input()
fields = input_line_1.split()
N = int(fields[0])
A = int(fields[1])
B = int(fields[2])
T = A + B
all = raw_input()
for every in all:
	if every == 'c':
		print 'No'
	elif every == 'a':
		if T > 0:
			T = T - 1
			print 'Yes'
		else:
			print 'No'
	else:
		if T > 0 and B > 0:
			T = T - 1
			B = B - 1
			print 'Yes'
		else:
			print 'No'

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

Solution (Python):
n, a, b = map(int, raw_input().split())
s = raw_input()
ac = 0
bc = 0
for v in s:
    if v == 'a' and ac + bc < a + b:
        ac += 1
        print "Yes"
    elif v == 'b' and ac + bc < a + b and bc < b:
        bc += 1
        print "Yes"
    else:
        print "No"

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

Solution (Python):
import sys 
import sys 

N,A,B = map(int,sys.stdin.readline().split())
S = sys.stdin.readline().strip()
passCount = 0 
overseasRank = 0 
i = 0 
while i < len(S):
    c = S[i]
    if c == 'a':
        if passCount < A+B:
            print 'Yes'
            passCount += 1
        else:
            print 'No'
    if c == 'b':
        overseasRank += 1
        if passCount < A+B:
            if overseasRank <= B:                                                                                                                                                                                                     
                print 'Yes'
                passCount += 1
            else:
                print 'No'
        else:
            print 'No'
    if c == 'c':
        print 'No'

    i += 1

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

    flag = 0
    m = A+B
    counter = 0
    f_counter = 0
    for i in range(len(S)):
        if S[i] == "a" and (counter+1)<=m:
            counter += 1
            print("Yes")
        elif S[i] == "b" and (counter+1<=m and f_counter+1 <= B):
            counter+=1
            f_counter += 1
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()

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

Ap = 0
Bp = 0
n = 0

while True:
    if S[n]=='a':
        if (Ap+Bp) < (A+B):
            print('Yes')
            Ap = Ap + 1
        else:
            print('No')
    if S[n]=='b':
        if ((Ap+Bp) < (A+B)) and Bp < B:
            print('Yes')
            Bp = Bp + 1
        else:
            print('No')
    if S[n]=='c':
        print ('No')
    n = n + 1
    
    if n == N:
        break

Solution (Python):
I = [int(e) for e in raw_input().split(' ')]
N = I[0]
A = I[1]
B = I[2]
S = raw_input()

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

Solution (Python):
raw_condition = raw_input()
result_line = raw_input()

N = int(raw_condition.split(" ")[0])
A = int(raw_condition.split(" ")[1])
B = int(raw_condition.split(" ")[2])

current_num = 0
international_ranking = 0
for result in result_line:
    if result == 'a':
        if current_num < A+B:
            current_num += 1
            print "Yes"
        else:
            print "No"
    elif result == 'b':
        if current_num < A+B and international_ranking < B:
            current_num += 1
            international_ranking += 1
            print "Yes"
        else:
            print "No"
    else:
        print "No"

Solution (Python):
import sys

N, A, B = map(int, sys.stdin.readline().split())
S = sys.stdin.readline()

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

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

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

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

bs = 0
passed = 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 bs < b:
			print 'Yes' 
			bs += 1
			passed += 1
		else:
			print 'No'
	if s[i] == 'c':
		print 'No'

Solution (Python):
arg1 = input().split()
arg2 = input()
N = arg1[0]
A = arg1[1]
B = arg1[2]
C = int(A) + int(B)
passed = 0
passed_f = 0
for i,s in enumerate(arg2):
    if s == 'a':
        if passed < C:
            passed += 1
            print('Yes')
            continue
    elif s == 'b':
        if passed < C and passed_f < int(B):
            passed += 1
            passed_f += 1
            print('Yes')
            continue
    print('No')

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

aa = 0
bb = 0
ans = []
for i in range(len(s)):
  if s[i] != "c":
    if s[i] == "a":
      if aa+bb < a+b:
        aa += 1
        ans.append("Yes")
      else:
        ans.append("No")

    if s[i] == "b":
      if aa+bb < a+b and bb < b:
        bb += 1
        ans.append("Yes")
      else:
        ans.append("No")
  else:
    ans.append("No")
for i in ans:
  print i