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]=[int(x) for x in raw_input().split()]
L=raw_input()
Kok=0
Out=0
for c in L:
    if c=='a':
        if Kok+Out<A+B:
            print 'Yes'
            Kok+=1
        else:
            print 'No'
    elif c=='b':
        if Kok+Out<A+B and Out<B:
            print 'Yes'
            Out+=1
        else:
            print 'No'
    else:
        print 'No'

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

Solution (Python):



N, A, B = map(int, raw_input().split())

s = raw_input()

over = 0
cnt = 0
for i in xrange(N):
    if s[i] == 'c':
        print 'No'
    elif s[i] == 'a':
        if cnt < A + B:
            print 'Yes'
            cnt += 1
        else:
            print 'No'
    else:
        over += 1
        if cnt < A + B and over <= B:
            print 'Yes'
            cnt += 1
        else:
            print 'No'

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

in_pass = 0
out_pass = 0
pass_num = 0

for c in s:
    if c == 'a' and pass_num < a + b:
        in_pass = in_pass + 1
        pass_num = pass_num + 1
        print 'Yes'
    elif c == 'b' and pass_num < a + b and out_pass + 1 <= b:
        out_pass = out_pass + 1
        pass_num = pass_num + 1
        print 'Yes'
    else:
        print 'No'

Solution (Python):
nab = list(map(lambda word: int(word), input().split(' ')))
s = input()

count = 0
foreign = 0
for student in s:
    if student == 'a' and count < nab[1] + nab[2]:
        print('Yes')
        count += 1
    elif student == 'b' and count < nab[1] + nab[2] and foreign + 1 <= nab[2]:
        print('Yes')
        count += 1
        foreign += 1
    else:
        print('No')

Solution (Python):

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


s = raw_input()

cnt = 0
cnt_o = 0

ls = []

for c in s:
    if c is 'a' and cnt < a + b:
        cnt += 1
        ls.append(True)
    elif c is 'b' and cnt < a + b and cnt_o < b:
        cnt += 1
        cnt_o += 1
        ls.append(True)
    else:
        ls.append(False)
    if cnt is a + b:
        break

ls = ls + map(lambda x: False, range(n - len(ls)))
            

print '\n'.join(map(lambda x: 'Yes' if x else 'No', ls))

Solution (Python):
N,A,B=map(int ,raw_input().split())
s=raw_input()
ls=list(s)
cou=0
fnum=1
for i in ls:

    if i=="a" and cou<A+B:
        print "Yes"
        cou+=1
    elif i=="b" and cou<A+B and  fnum<=B:
        print "Yes"
        cou+=1
        fnum+=1
    else:
        print "No"

Solution (Python):
import math
from collections import Counter
N,A,B = [int(a) for a in raw_input().strip().split()]
S = raw_input().strip()

passed = 0
foreign = 1
result = []
y = 'Yes'
n = 'No'

for Si in S:
  if Si == 'a':
    if passed < A+B:
      result.append(y)
      passed += 1
    else:
      result.append(n)
  elif Si == 'b':
    if passed < A+B and foreign <= B:
      result.append(y)
      passed += 1
      foreign += 1
    else:
      result.append(n)
  else:
    result.append(n)

print "\n".join(result)

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

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

Solution (Python):
N,A,B=map(int,raw_input().split())
S = raw_input()
for cha	in S:
    if cha == 'a' and (A+B) > 0:
	A = A-1
	print 'Yes'
        pass
    elif cha == 'b' and B > 0 and (A+B)>0:
        B = B-1
	print 'Yes'
        pass
    elif cha == 'c':
	print 'No'
        pass
    else:
	print 'No'
        pass

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

for pp in p:
    print pp

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

passed = 0
overseas = 0

for i, c in enumerate(s):
    if c == 'a':
        if passed < (a+b):
            passed += 1
            print 'Yes'
        else:
            print 'No'
    elif c == 'b':
        if passed < (a+b) and overseas < b:
            passed += 1
            overseas += 1
            print 'Yes'
        else:
            print 'No'
    else:
        print 'No'

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

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

AB = A+B
for i in input():
    if AB > 0:
        if i == "a":
            AB -= 1
            print('Yes')
            continue
        elif i == 'b':
            if B > 0:
                B -= 1
                AB -= 1
                print('Yes')
                continue
    print('No')

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

for e in s:
    if e == "c":
        print "No"
    elif e == "b":
        if b > 0 and c > 0:
            print "Yes"
            b -= 1
            c -= 1
        else:
            print "No"
    else:
        if c > 0:
            print "Yes"
            c -= 1
        else:
            print "No"

Solution (Python):
x=raw_input()

n,a,b = [int(i) for i in x.split()]


s = raw_input()

a_c = 0
b_c = 0

for p in s:
    if(p=='a' and a_c+b_c<a+b):
        print 'Yes'
        a_c += 1
    
    elif(p=='b' and a_c+b_c<a+b and b_c<b):
        print 'Yes'
        b_c += 1

    else:
        print 'No'

Solution (Python):

import math,string,itertools,fractions,heapq,collections,re,array,bisect

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

EPS = 1e-9


def dot(a, b):
    return a.real * b.real + a.imag * b.imag

def cross(a, b):
    return a.real * b.imag - a.imag * b.real

def distance(a, b, c):
    if dot(b-a, c-a) <= EPS:
        return abs(c-a)
    if dot(a-b, c-b) <= EPS:
        return abs(c-b)
    return abs(cross(b-a, c-a)/(b-a))

N, A, B = ln()
S = s()

AB = A + B
d = 0
f = 0
for i in S:
    if i == 'a' and d < AB:
        d += 1
        print 'Yes'
    elif i == 'b':
        f += 1
        if d < AB and f <= B:
            d += 1
            print 'Yes'
        else:
            print 'No'
    else:
        print 'No'

Solution (Python):
N, A, B = list(map(int, input().split()))
a, b = 0, 0
for e in input():
    if e == "a" and (a + b) < (A + B):
        print("Yes")
        a += 1
    elif e == "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()

n_ab = 0
n_b = 0

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

Solution (Python):

n, a, b = list(map(lambda x: int(x), input().split()))
s = input()


num_a = 0
num_b = 0

rank_b = 0

for i in range(len(s)):
    if s[i] == 'c':
        print('No')

    elif s[i] == 'a':
        if num_a + num_b < a + b:
            print('Yes')
            num_a += 1
        else:
            print('No')

    elif s[i] == 'b':
        rank_b += 1

        if num_a + num_b < a + b and rank_b <= b:
            print('Yes')
            num_b += 1
        else:
            print('No')

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

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

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

for c in S:
    if c == 'a':
        if ab_cnt < A+B:
            print('Yes')
            a_cnt += 1
            ab_cnt += 1
        else:
            print('No')
    elif c == 'b':
        if ab_cnt < A+B and b_cnt < B:
            print('Yes')
            b_cnt += 1
            ab_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):
def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split(sep)))

def main():
    n, a, b = reads()
    s = input()
    
    ai, bi = 0, 0
    for c in s:
        if c == 'a':
            if ai+bi < a+b:
                print('Yes')
                ai += 1
            else:
                print('No')
        elif c == 'b':
            if ai+bi < a+b and bi < b:
                print('Yes')
                bi += 1
            else:
                print('No')
        else:
            print('No')

main()

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


t = 0
o = 0
for s in S:
    if s == 'a':
        if t < A + B:
            print('Yes')
            t += 1
        else:
            print('No')

    if s == 'b':
        if t < A + B and o < B:
            print('Yes')
            t += 1
            o += 1
        else:
            print('No')

    if s == 'c':
        print('No')

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

ab = a+b
abcount = 0
bcount = 0
for c in s:
    if c == 'a' and abcount < ab:
        abcount += 1
        print 'Yes'
    elif c == 'b' and abcount < ab and bcount < b:
        abcount += 1
        bcount += 1
        print 'Yes'
    else:
        print 'No'

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

S =input()

total = 0
kaigai = 0
for i,s in enumerate(S):
    if s=='a':
        if total<A+B:
            print("Yes")
            total +=1
        else:
            print("No")
    elif s=="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 = map(int,raw_input().split(" "))
S = raw_input()
C = A+B


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
            b+=1
        else:
            print "No"
    else:
        print "No"

Solution (Python):
import collections


n, a, b = map(int, input().split())
s = collections.deque(input())
total = 0
oversea = 0
while s:
    x = s.popleft()
    if x == "c":
        print("No")
    elif x == "a":
        if total < a + b:
            total += 1
            print("Yes")
        else:
            print("No")
    elif x == "b":
        if total >= a + b:
            print("No")
        elif oversea >= b:
            print("No")
        else:
            total += 1
            oversea += 1
            print("Yes")

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

ca = 0
cb = 0
ans = [0]*n
for i in xrange(n):
    if ca+cb == a+b:
        break
    if s[i] == 'a':
        ca += 1
        ans[i] = 1
    if s[i] == 'b' and cb < b:
        cb += 1
        ans[i] = 1
for i in xrange(n):
    if ans[i]:
        print "Yes"
    else:
        print "No"

Solution (Python):



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

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

Solution (Python):

import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

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

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

Solution (Python):
n, a, b = map(int, raw_input().split())
s = raw_input()
for e in s:
    if e == "a":
        if a > 0:
            print "Yes"
            a -= 1
        elif b > 0:
            print "Yes"
            b -= 1
        else:
            print "No"
    elif e == "b":
        if b > 0:
            print "Yes"
            b -= 1
        else:
            print "No"
    else:
        print "No"

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

ac, bc = 0, 0

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