jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	x := make([]int, n)
	for i := range x {
		fmt.Scan(&x[i])
	}

	y := sort(x)
	l := n / 2
	y1 := y[l - 1]
	y2 := y[l]

	for _, v := range x {
		var b int
		if (v <= y1) {
			b = y2
		} else {
			b = y1
		}
		fmt.Println(b)
	}
}

func sort(a []int) []int {
	b := make([]int, len(a))
	for i := range b {
		b[i] = a[i]
	}

	l := len(a)
	for i := 0; i < l; i++ {
		for j := l - 1; j > i; j-- {
			if b[j-1] > b[j] {
				b[j-1], b[j] = b[j], b[j-1]
			}
		}
	}

	return b
}
//  [python]
import sys


def main():
    n, a, b = map(int, sys.stdin.readline().split())
    s = sys.stdin.readline().rstrip()

    ans = ["No"] * n
    success = 0
    foreigner = 0

    for i in range(n):
        if s[i] == "a":
            ans[i] = "Yes"
            success += 1
        elif s[i] == "b" and foreigner < b:
            ans[i] = "Yes"
            success += 1
            foreigner += 1
        if success == a + b:
            break

    print("\n".join(ans))
    return


if __name__ == "__main__":
    main()
//  [python]
def solve1(n, a, b, s):
    ans = ["No" for i in range(len(s))]

    #print("|     i|s[i]|     a|     b|ans[i]|")
    #print("----------------------------------")

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

        #print(f"|{i:6d}|{s[i]:4s}|{a:6d}|{b:6d}|{ans[i]:6s}|")

    return ans


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

print("\n".join(solve1(n, a, b, s)))
//  [python]
def resolve():
  N, A, B = [int(i) for i in input().split()]
  S = input()
  
  passed_a = 0
  passed_b = 0
  result = [False]*N
  
  for i in range(N):
    if S[i] == "a":
      if passed_a + passed_b < A + B:
        passed_a += 1
        result[i] = True
    
    elif S[i] == "b":
      if passed_a + passed_b < A + B and passed_b < B:
        passed_b += 1
        result[i] = True

  ans = ["Yes" if i else "No" for i in result]
  print("\n".join(ans))

resolve()
//  [python]
n,a,b=map(int,input().split())
s=input().strip()
njp=0
nop=0
for i in range(len(s)):
  if s[i]=='a':
    if njp<(a+b):
      njp+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if njp<(a+b):
      if nop<=b:
        nop+=1
        njp+=1
        print('yes')
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')
//  [python]
n,x,y=map(int,input().split())
s= input()
c=0
d=x+y
e = 0
f= False
for i in range(n):
    if s[i]=="a":
        if c<d:
            f=True
    elif s[i]=="b":
        if c<d and e<y:
            f=True
    if f:
        print("Yes")
        c+=1
    else:
        print("No")
    f=False
//  [python]
n,x,y=map(int,input().split())
s= input()
c=0
d=x+y
f= False
for i in range(n):
    if s[i]=="a":
        if c<=d:
            f=True
    elif s[i]=="b":
        if c<=d and c<=y:
            f=True
    if f:
        print("Yes")
        c+=1
    else:
        print("No")
    f=False
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;


public class Main {
    public static void main(String[] args) {
        FastScanner fsc = new FastScanner();
        int n=fsc.nextInt();
        int a=fsc.nextInt();
        int b=fsc.nextInt();
        char[] s=fsc.next().toCharArray();
        int cnt=0;
        int os=0;
        StringBuilder sb = new StringBuilder();
        for(char c:s){
            if (c == 'a') {
                if (cnt < a + b) {
                    ++cnt;
                    sb.append("Yes\n");
                } else {
                    sb.append("No\n");
                }
            } else if (c == 'b') {
                if (cnt < a + b && os < b) {
                    ++cnt;
                    ++os;
                    sb.append("Yes\n");
                } else {
                    sb.append("No\n");
                }
            } else {
                sb.append("No\n");
            }
        }
        System.out.print(sb);
    }
}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}
//  [java]
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int total = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int ashikiri = a + b;
        String s = sc.next();
        int passed = 0;
        int foreigner_count = 0;
        for (int i = 0; i < total; i++) {
            if (s.charAt(i) == 'a') {
                if (passed < ashikiri) {
                    passed++;
                    out.println("Yes");
                } else {
                    out.println("No");
                }
            } else if (s.charAt(i) == 'b') {
                foreigner_count++;
                if ((passed < ashikiri) && (foreigner_count <= b)) {
                    passed++;
                    out.println("Yes");
                } else {
                    out.println("No");
                }
            } else {
                out.println("No");
            }
        }
        sc.close();
    }

}
//  [java]
import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static FScanner sc;
    public static PrintWriter out;
    public static void main(String[] args) {
        sc=new FScanner();
        out=new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        String seq = sc.next();

        int counter = 0;
        int counter2 = 0;
        for(int p = 0; p < n; p++){
            if(seq.charAt(p) == 'a' && counter < a + b){
                counter++;
                if(seq.charAt(p) == 'b' && counter2 <= b && counter < a + b){
                    counter2++;
                }
                out.println("Yes");
            }

            else{
                out.println("No");
            }
        }




        out.close();
    }

    //-----------------------------------------------------HERE---------------------------------------------------------



    //------------------------------------------------------------------------------------------------------------------

    //scanner
    public static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}
//  [cpp]
#include <cstdio>

int main()
{
  int n, A, B;
  char s[100001];
  scanf("%d%d%d%s", &n, &A, &B, s);
  int a = 0, b = 0;
  for (char *p = s; *p; ++p)
  {
    if (*p == 'a')
    {
      if (a + b < A + B)
      {
        puts("Yes");
        ++a;
      }
      else
      {
        puts("No");
      }
    }
    else if (*p == 'b')
    {
      if (a + b < A + B && b < B)
      {
        puts("Yes");
        ++b;
      }
      else
      {
        puts("No");
      }
    }
    else puts("No");
  }
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int n, a, b, c, d;
char str[100010];

int main(){
	scanf("%d%d%d%s", &n, &a, &b, str);
	for(int i = 0; str[i]; i++){
		switch(str[i]){
		case 'a':
			if(c < a + b){
				c++;
				puts("Yes");
			}
			else puts("No");
			break;
		case 'b':
			d++;
			if(c < a + b && d <= b){
				c++;
				puts("Yes");
			}
			else puts("No");
			break;
		default:
			puts("No");
		}

	}
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main() {
    int n,a,b;cin>>n>>a>>b;
    int ca = 0;
    int cb = 0;
    string s;cin>>s;
    rep(i,n){
        if(s[i]=='a' && ca + cb< a + b){
            cout<<"Yes"<<endl;
            ++ca;
        }
        else if(s[i]=='b' && ca + cb< a + b && cb <= b){
            cout<<"Yes"<<endl;
            ++cb;
        }
        else cout<<"No"<<endl;
    }
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,A,B,total;
    cin>>n>>A>>B;
    total = A+B;
    string s;
    cin>>s;
    int b = 0;
    for(int i=0;i<n;i++){
        if(s[i] == 'c' || total <= 0 ){
            cout<<"No"<<endl;
            continue;
        }else if(s[i] == 'b' && B--){
            cout<<"Yes"<<endl;
            total--;
        }else if(s[i] == 'b' && B <= 0){
            cout<<"No"<<endl;
        }else{
            cout<<"Yes"<<endl;
            total--;
        }
    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,A,B,total;
    cin>>n>>A>>B;
    total = A+B;
    string s;
    cin>>s;
    int b = 0;
    for(int i=0;i<n;i++){
        if(s[i] == 'c' || total <= 0 ){
            cout<<"No"<<endl;
            continue;
        }else if(s[i] == 'b' && B--){
            cout<<"Yes"<<endl;
            total--;
        }else if(s[i] == 'b' && B <= 0){
            cout<<"No"<<endl;
        }else if(s[i] == 'a'){
            cout<<"Yes"<<endl;
            total--;
        }
    }
}
//  [c]
#include <stdio.h>

char s[100010];
int main(){
	int n,a,b;
	scanf("%d%d%d%s",&n,&a,&b,s);
	int cnt=0;
	int bcnt=0;
	for(int i=0;i<n;i++){
		if(s[i]=='a')puts(cnt<a+b?cnt++,"Yes":"No");
		else if(s[i]=='b')puts(cnt<a+b&&++bcnt<=b?cnt++,"Yes":"No");
		else puts("No");
	}
}
//  [c]
#include <stdio.h>
#include <string.h>

void readInt(int *x) {
	scanf("%d", x);
	return;
}
void readInts(int n, int arr[]) {
	int i;
	for (i=0;i<n;i++) {
		readInt(&arr[i]);
	}
}
void readChar(char *x) {
	scanf("%c", x);
	return;
}
void readChars(char x[]) {
	scanf("%s", x);
	return;
}
void readString(char *x) {
	scanf("%s",x);
	return;
}
void printInts(int n, int *arr) {
	int i;
	for (i=0;i<n;i++) {
		printf("%d ", arr[i]);
	}
	printf("\n");
	return;
}
void swap(int *x, int *y) {
	int tmp;
	tmp = *x;
	*x = *y;
	*y = tmp;
	return;
}
void quicksort(int x[], int left, int right) {
	int i,j;
	int pivot;

	i = left;
	j = right;

	pivot = x[(left+right)/2];
	while (1) {
		while (x[i] < pivot) i++;
		while (pivot < x[j]) j--;
		if (i>=j) break;
		swap(&x[i],&x[j]);
		i++;
		j--;
	}
	if (left < i-1) quicksort(x, left, i-1);
	if (j+1 < right) quicksort(x, j+1, right);
}

int main(int argc, char const *argv[])
{
	int n,a,b;
	readInt(&n);
	readInt(&a);
	readInt(&b);
	char s[100001];
	char *p = s;
	readString(s);
	char item;
	int count = 0;
	int rank=1;

	while (*p!='\0') {
		//printf("%c\n", *p);
		item = *p;
		if (item=='c') {
			printf("No\n");
		} else if (item=='a') {
			if (count<a+b) {
				printf("Yes\n");
				count++;
			}else{
				printf("No\n");
			}
		} else {
			if (count<a+b && rank<=b) {
				rank++;
				count++;
				printf("Yes\n");
			}else{
				printf("No\n");
			}
		}
		p++;
	}

	return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	long N, A, B;
	char S[100001];
	scanf("%ld %ld %ld", &N, &A, &B);
	scanf("%s", S);
	
	int i, flag[100000] = {}, total = 0, domestic = 0, abroad = 0;
	for (i = 0; i < N; i++) {
		if (S[i] == 'a') {
			if (total < A + B) {
				flag[i] = 1;
				total++;
				domestic++;
			}
		} else if (S[i] == 'b') {
			abroad++;
			if (total < A + B && abroad <= B) {
				flag[i] = 1;
				total++;
			}
		}
	}
	
	for (i = 0; i < N; i++) {
		if (flag[i] == 1) printf("Yes\n");
		else printf("No\n");
	}
	fflush(stdout);
	return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int N,B,A;
  scanf("%d%d%d",&N,&A,&B);
  char S[N];
  scanf("%s",S);

  int counta=0,countb=0;

  for(int i=0;i<N;i++){
    if(S[i]=='a'){
      if(A+B>counta){
        counta++;
        printf("Yes\n");
      }
}
    else if(S[i]=='b'){
      if(A+B>counta && countb<=B){
        countb++;
        counta++;
        printf("Yes\n");
      }
    }

    else {
      printf("No\n");
    }
  return 0;
}
}
//  [c]
#include<stdio.h>
int main(){
  int N,B,A;
  scanf("%d%d%d",&N,&B,&A);
  char S[10000000];
  scanf("%s",S);

  int counta=0,countb=0;

  for(int i=0;i<N;i++){
    if(S[i]=='a'){
      if(A+B>counta){
        counta++;
        printf("Yes\n");
      }
}
    else if(S[i]=='b'){
      if(A+B>counta && countb<=B){
        countb++;
        counta++;
        printf("Yes\n");
      }
    }

    else {
      printf("No\n");
    }
  return 0;
}
}
//  [c]
#include<stdio.h>
int main(){
  int N,B,A;
  scanf("%d%d%d",&N,&B,&A);
  char S[10000000];
  scanf("%s",S);

  int counta=0,countb=0;

  for(int i=0;i<N;i++){
    if(S[i]=='a'){
      if(A+B>counta){
        counta++;
        printf("Yes\n");
      }

    else if(S[i]=='b'){
      if(A+B>counta && countb<=B){
        countb++;
        counta++;
        printf("Yes\n");
      }

    else {
      printf("No\n");
    }
  }
  return 0;
}
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,3);
  var N = myconv(input[0],4)[0];
  var A = myconv(input[0],4)[1];
  var B = myconv(input[0],4)[2];
  var count = 0;
  var tmpB = 0;
  var list = myconv(input[1],6);
  var output = [];
  for(var i = 0; i < N; i++){
    var tmp = list[i];
    if(tmp == "a"){
       if(count < A+B){
          count++;
         output.push("Yes");
       }else{
         output.push("No");
       }
    }else if(tmp == "b"){
       if(count < A+B && tmpB < B){
          count++;
         tmpB++;
         output.push("Yes");
       }else{
         output.push("No");
       }      
	}else{
      output.push("No");
    }
  }
  myout(output.join("\n"));
}
Main(myin());
//  [javascript]
'use strict'

const Main = (input) => {
  const tmp = input.trim().split('\n')
  const N = parseInt(tmp[0].split(' ')[0])
  const A = parseInt(tmp[0].split(' ')[1])
  const B = parseInt(tmp[0].split(' ')[2])
  const S = tmp[1].split('')
  //a 国内
  //b 海外
  //c どちらでもない

  let result = []
  let count = 0
  let overseas = 0

  for (let i = 0; i < N; i++) {
    const participant = S[i]
    if (participant === 'a') {
      if (count < (A + B)) {
        result.push('Yes')
        count += 1
      } else {
        result.push('No')
      }
    } else if (participant === 'b') {
      if (count < (A + B) && overseas < B) {
        result.push('Yes')
        count += 1
        overseas += 1
      } else {
        result.push('No')
      }
    } else {
      result.push('No')
    }
  }
  result = result.join('\n')

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const [N, A, B] = lines[0].split(" ").map(v=>v-0);
    const list = lines[1].split("");
    const map = [];
    let go = 0;
    let go2=0;
    list.forEach((v,i)=>{
        map[i] = false;
        if(go < A+B){
            if(v==="a"){
                go++;
                map[i] = true;
            }else if(v==="b" && go2 < B){
                go++;
                go2++;
                map[i] = true;
            }
        }
    });
    console.log(map.map(v=>v?"Yes":"No").join("\n"));
});
//  [javascript]
'use strict'

const Main = (input) => {
  const tmp = input.trim().split('\n')
  const N = parseInt(tmp[0].split(' ')[0])
  const A = parseInt(tmp[0].split(' ')[1])
  const B = parseInt(tmp[0].split(' ')[2])
  const S = tmp[1]
  //a 国内
  //b 海外
  //c どちらでもない

  let result = []
  let count = 0
  let overseas = 0

  for (let i = 0; i < N; i++) {
    const participant = S.split('')[i]
    if (participant === 'a') {
      if (count < (A + B)) {
        result.push('Yes')
        count += 1
      } else {
        result.push('No')
      }
    } else if (participant === 'b') {
      if (count < (A + B) && overseas < B) {
        result.push('Yes')
        count += 1
        overseas += 1
      } else {
        result.push('No')
      }
    } else {
      result.push('No')
    }
  }
  result = result.join('\n')

  console.log(result)
  return result
}


Main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
'use strict';

function main(input) {
  const arr = input.trim().split('\n');
  const a = arr[0].split(' ').map(x => Number(x));
  const challengers = arr[1].split('');
  const isPass = [];
  let foreigner = 0;

  for (let i = 0; i < challengers.length; i++) {
    if (challengers[i] === 'a') {
      if (i + 1 < a[1] + a[2]) {
        isPass[i] = 'Yes\n';
        continue;
      } else {
        isPass[i] = 'No\n';
      }
    } else if (challengers[i] === 'b') {
      for (let j = 0; j < i; j++) {
        if (challengers[j] === 'b') {
          foreigner++;
        }
      }
      if (i + 1 < a[1] + a[2] && i + 1 < foreigner) {
        isPass[i] = 'Yes\n';
        continue;
      } else {
        isPass[i] = 'No\n';
      }
      foreigner = 0;
    } else {
      isPass[i] = 'No\n';
      continue;
    }
    console.log(isPass[i]);
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';

function main(input) {
  const arr = input.trim().split('\n');
  const a = arr[0].split(' ').map(x => Number(x));
  const challengers = arr[1].split('');
  const isPass = [];
  let foreigner = 0;

  for (let i = 0; i < challengers.length; i++) {
    if (challengers[i] === 'a') {
      if (i + 1 < a[1] + a[2]) {
        isPass[i] = true;
        continue;
      } else {
        isPass[i] = false;
      }
    } else if (challengers[i] === 'b') {
      for (let j = 0; j < i; j++) {
        if (challengers[j] === 'b') {
          foreigner++;
        }
      }
      if (i + 1 < foreigner) {
        isPass[i] = true;
        continue;
      } else {
        isPass[i] = false;
      }
      foreigner = 0;
    } else {
      isPass[i] = false;
      continue;
    }
  }

  for (let i = 0; i < isPass.length; i++) {
    if (isPass[i]) {
      console.log('Yes\n');
    } else {
      console.log('No\n');
    }
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func main() {
	var n, a, b int
	fmt.Scan(&n, &a, &b)
	s := nextMega()

	rank := 0
	sum := 0
	for i := 0; i < n; i++ {
		ok := false
		if s[i] == 'a' && sum < a+b {
			sum++
			ok = true
		} else if s[i] == 'b' {
			rank++
			if sum < a+b && rank <= b {
				sum++
				ok = true
			}
		}
		if ok {
			puts("Yes")
		} else {
			puts("No")
		}
	}
	wt.Flush()
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	var n, a, b int
	fmt.Scan(&n, &a, &b)
	s := nextMega()

	rank := 0
	sum := 0
	for i := 0; i < n; i++ {
		ok := false
		if s[i] == 'a' && sum < a+b {
			sum++
			ok = true
		} else if s[i] == 'b' {
			rank++
			if sum < a+b && rank <= b {
				sum++
				ok = true
			}
		}
		if ok {
			fmt.Fprintln(wt, "Yes")
		} else {
			fmt.Fprintln(wt, "No")
		}
	}
	wt.Flush()
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func contains(target string, list []string) bool {
	for _, r := range list {
		if target == r {
			return true
		}
	}
	return false
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()

	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextF64() float64 {
	sc.Scan()

	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func isInteger(x float64) bool {
	return math.Floor(x) == x
}

func Ave(s []int) int {
	val := 0
	for _, i := range s {
		val += i
	}
	return int(val / len(s))
}
func cal(i int) (sum int) {
	for i != 0 {
		sum += i % 10
		i /= 10
	}
	return
}
func max(a []int) (idx int, val int) {
	max := a[0]
	idx = 0
	for j, i := range a {
		if max < i {
			max = i
			idx = j
		}
	}
	return idx, max
}

func draw(i int, a []int) (l []int) {
	// p = a[i]
	for j := i; j < len(a); j++ {
		if j != len(a)-1 {
			a[j] = a[j+1]
		} else if j == len(a)-1 {
			a = a[:len(a)-1]
		}
	}
	return a
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	a := nextInt()
	b := nextInt()

	s := nextLine()
	var pass int
	var bpass int

	for i := 0; i < n; i++ {
		switch string(s[i]) {
		case "a":
			if pass < a+b {
				pass++
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		case "b":
			bpass++
			if pass < a+b && bpass <= b {
				pass++
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		case "c":
			fmt.Println("No")
		}
	}

}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func contains(target string, list []string) bool {
	for _, r := range list {
		if target == r {
			return true
		}
	}
	return false
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()

	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextF64() float64 {
	sc.Scan()

	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func isInteger(x float64) bool {
	return math.Floor(x) == x
}

func Ave(s []int) int {
	val := 0
	for _, i := range s {
		val += i
	}
	return int(val / len(s))
}
func cal(i int) (sum int) {
	for i != 0 {
		sum += i % 10
		i /= 10
	}
	return
}
func max(a []int) (idx int, val int) {
	max := a[0]
	idx = 0
	for j, i := range a {
		if max < i {
			max = i
			idx = j
		}
	}
	return idx, max
}

func draw(i int, a []int) (l []int) {
	// p = a[i]
	for j := i; j < len(a); j++ {
		if j != len(a)-1 {
			a[j] = a[j+1]
		} else if j == len(a)-1 {
			a = a[:len(a)-1]
		}
	}
	return a
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 100000), 100000)
	n := nextInt()
	a := nextInt()
	b := nextInt()

	s := readLine()
	var pass int
	var bpass int

	for i := 0; i < n; i++ {
		switch string(s[i]) {
		case "a":
			if pass < a+b {
				pass++
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		case "b":
			bpass++
			if pass < a+b && bpass <= b {
				pass++
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		case "c":
			fmt.Println("No")
		}
	}

}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func contains(target string, list []string) bool {
	for _, r := range list {
		if target == r {
			return true
		}
	}
	return false
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()

	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextF64() float64 {
	sc.Scan()

	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func isInteger(x float64) bool {
	return math.Floor(x) == x
}

func Ave(s []int) int {
	val := 0
	for _, i := range s {
		val += i
	}
	return int(val / len(s))
}
func cal(i int) (sum int) {
	for i != 0 {
		sum += i % 10
		i /= 10
	}
	return
}
func max(a []int) (idx int, val int) {
	max := a[0]
	idx = 0
	for j, i := range a {
		if max < i {
			max = i
			idx = j
		}
	}
	return idx, max
}

func draw(i int, a []int) (l []int) {
	// p = a[i]
	for j := i; j < len(a); j++ {
		if j != len(a)-1 {
			a[j] = a[j+1]
		} else if j == len(a)-1 {
			a = a[:len(a)-1]
		}
	}
	return a
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 100000), 100000)
	n := nextInt()
	a := nextInt()
	b := nextInt()

	s := readLine()
	var pass int
	var bpass int

	x := strings.Split(s, "")

	for i := 0; i < n; i++ {
		switch x[i] {
		case "a":
			if pass < a+b {
				pass++
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		case "b":
			bpass++
			if pass < a+b && bpass <= b {
				pass++
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		case "c":
			fmt.Println("No")
		}
	}

}
//  [ruby]
n,a,b=gets.split.map &:to_i
x=y=0
gets.chomp.bytes{|c|
  puts (c==98&&(y+=1)<=b||c==97)&&(x+=1)<=a+b ? "Yes":"No"
}
//  [ruby]
n,a,b = gets.split.map(&:to_i)
s = gets.chomp

s.each_char do |c|
    case c
    when "a"
        if a + b > 0
            a -= 1
            puts "Yes"
        else
            puts "No"
        end
    when "b"
        if a + b > 0 && b > 0
            b -= 1
            puts "Yes"
        else
            puts "No"
        end
    else puts "No"
    end
end
//  [ruby]
n, a, b = gets.split.map(&:to_i)
s = gets.chomp
a += b
s.each_char{|c|
	case c
	when ?a
		if a>0
			a -= 1
			puts "Yes"
		else
			puts "No"	
		end
	when ?b
		if a>0 and b>0
			a -= 1
			b -= 1
			puts "Yes"
		else
			puts "No"
		end
	when ?c
		puts "No"
	end
}
//  [ruby]
n,a,b=gets.chomp.split(" ").map(&:to_i)
arr = gets.chomp.split('')
n.times do |k|
  if arr[k] == 'a' && a > 0
    puts "Yes"
    a -= 1
  elsif arr[k] == 'b' && b > 0
    puts "Yes"
    b -= 1
  else
    puts "No"
  end
end
//  [ruby]
n,a,b = gets.split.map(&:to_i)
s = gets.strip

passed = 0
abroad = b

s.chars.each do |char|
  if char == 'a'
    if passed < a + b
      puts 'Yes'
    else
      puts 'No'
    end
  elsif char == 'b'
    if passed < a + b && abroad > 0
      puts 'Yes'
      abroad -= 1
    else
      puts 'No'
    end
  else
    puts 'No'
  end
end
//  [ruby]
n,a,b = gets.split(' ').map(&:to_i)
s = gets.split('').map(&:to_s)

pass = 0
n.times do |i|
	if(s[i] == 'a') && (pass < (a + b))
			pass += 1
			puts 'Yes'
	elsif(s[i] == 'b') && (pass < (a + b)) && (i <= b)
			pass += 1
			puts 'Yes'
	else
		puts 'No'
	end
end
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let (N, A, B): (usize, usize, usize) = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap()
        )
    };
    let S: Vec<char> = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().chars().collect()
    };

    let ans = S.iter().scan((0, 0), |s, &c| {
        let (x, y) = *s;
        if c == 'a' && x < A + B {
            *s = (x + 1, y);
            Some("Yes")
        } else if c == 'b' && x < A + B && y < B {
            *s = (x + 1, y + 1);
            Some("Yes")
        } else {
            Some("No")
        }
    })
    .collect::<Vec<_>>()
    .join("\n");

    println!("{}", ans);
}
//  [rust]
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        input_inner!{$s, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($exp_input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                let start = std::time::Instant::now();
                let input = solve($exp_input);
                let end = start.elapsed();
                assert_eq!(input, $output, "{}.{:03}", end.as_secs(), end.subsec_millis());
                assert!(end.as_secs() <= 2, "expected_sec: {}sec, actual_sec: {}sec", 2, end.as_secs());
                assert!(end.as_secs() <= 1, "expected_sec: {}sec, actual_sec: {}sec", 1, end.as_secs());
                assert!(end.subsec_millis() <= 10, "expected_ms: {}ms, actual_ms: {}ms", 10, end.subsec_millis());
                assert!(end.subsec_millis() <= 2, "expected_ms: {}ms, actual_ms: {}ms", 2, end.subsec_millis());
            )*
        }
    };
}

test! {
r#"10 2 3
abccabaabb"# => r#"Yes
Yes
No
No
Yes
Yes
Yes
No
No
No"#,

r#"12 5 2
cabbabaacaba"# => r#"No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No"#,
}

fn solve(src: &str) -> String {
    let mut src_iter = src.split_whitespace();
    input! {
        source = src_iter,
        n: usize,
        a: usize,
        b: usize,
        s: chars,
    }
    let mut ans = "".to_string();
    let mut cnt = 0;
    let mut b_cnt = 0;

    for i in 0..n {
        if (s[i] == 'a' && cnt < a + b) ||
           (s[i] == 'b' && cnt < a + b && b_cnt < b) {
            ans.push_str("Yes");
            cnt += 1;
            if s[i] == 'b' {
                b_cnt += 1;
            }
        } else {
            ans.push_str("No");
        }
        if i != n - 1 {
            ans.push_str("\n");
        }
    }
    ans.to_string()
}
//  [rust]
use std::io::{stdout, Write, BufWriter};

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: i32,
        a: i32,
        b: i32,
        s: String,
    }
    let s = s.as_bytes();
    let out = stdout();
    let mut out = BufWriter::new(out.lock());

    let mut n_q = 0;
    let mut rank = 1;
    for &p in s {
        match p {
            b'a' if n_q < a + b => {
                n_q += 1;
                writeln!(out, "Yes").unwrap();
            },
            b'b' if n_q < a + b && rank <= b => {
                n_q += 1;
                rank += 1;
                writeln!(out, "Yes").unwrap();
            },
            _ => {writeln!(out, "No").unwrap();},
        }
    }
}
//  [rust]
use proconio::input;
fn main() {
    input! {
        _: usize,
        a: usize,
        b: usize,
        s: String
    }

    let lim = a + b;
    let mut count = 0;
    let oversea = b;
    let mut ocount = 0;

    for c in s.chars() {
        if c == 'c' {
            println!("No");
            continue;
        }

        if lim <= count {
            println!("No");
            continue;
        }

        if c == 'b' && oversea < ocount {
            println!("No");
            continue;
        }

        count += 1;
        ocount += 1;

        println!("Yes");
    }
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: i32,
        a: i32,
        b: i32,
        s: String,
    }
    let s = s.as_bytes();

    let mut n_q = 0;
    let mut rank = 1;
    for p in s {
        match p {
            b'a' if n_q < a + b => {
                n_q += 1;
                println!("Yes");
            },
            b'b' if n_q < a + b && rank <= b => {
                n_q += 1;
                rank += 1;
                println!("Yes");
            },
            _ => {println!("No");},
        }
    }
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
    n: usize,
    a: usize,
    b: usize,
    s: chars
    }
    calc(n, a, b, s);
}

fn calc(n: usize, a: usize, b: usize, s: Vec<char>) {
    let mut domestic: usize = 0;
    let mut ex: usize = 0;
    for c in s {
        match c {
            'a' => { println!("{}", if domestic + ex < a + b {"Yes"} else {"No"});domestic += 1; }
            'b' => { println!("{}", if (domestic + ex < a + b) && (ex < b) {"Yes"} else {"No"});ex += 1; }
            _ => {println!("{}", "No")}
        }
    }
}
//  [swift]
import Foundation

let NAB = readLine()!.components(separatedBy: " ")
let S = readLine()!

let N = Int(NAB[0])!
let A = Int(NAB[1])!
let B = Int(NAB[2])!

var curr_passed = 0
var curr_b_rank = 0

for c in S {
    switch c {
    case "a": do {
        if curr_passed < A + B {
            print("Yes")
            curr_passed += 1
        } else {
            print("No")
        }
    }
    case "b": do {
        curr_b_rank += 1
        if curr_passed < A + B, curr_b_rank <= B {
            print("Yes")
            curr_passed += 1
        } else {
            print("No")
        }
    }
    case "c": do {
        print("No")
    }
    default:
        assert(false)
    }
}
//  [swift]
let input = readLine()!.characters.split(" ").map{Int(String($0))!}
var A = input[1]
var B = input[2]
for c in readLine()!.characters {
  if c=="a" && A+B>0 {
    print("Yes")
    A>0 ?(A--):(B--)
  } else if c=="b" && B>0 {
    print("Yes")
    B--
  } else {
    print("No")
  }
}
//  [swift]
let nab = readLine()!.characters.split(" ").map { Int(String($0))! }
let s = readLine()!.characters

var count = 0
var foreign = 0
for student in s {
    switch student {
    case "a" where count < nab[1] + nab[2]:
        print("Yes")
        count += 1
    case "b" where count < nab[1] + nab[2] && foreign + 1 <= nab[2]:
        print("Yes")
        count += 1
        foreign += 1
    default:
        print("No")
    }
}
//  [swift]
import Foundation

let NAB = readLine()!.components(separatedBy: " ")
let S = readLine()!

let N = Int(NAB[0])!
let A = Int(NAB[1])!
let B = Int(NAB[2])!

var curr_passed = 0
var curr_b_rank = 0

for c in S {
    switch c {
    case "a": do {
        if curr_passed < A + B {
            print("Yes")
            curr_passed += 1
        }
    }
    case "b": do {
        curr_b_rank += 1
        if curr_passed < A + B, curr_b_rank <= B {
            print("Yes")
            curr_passed += 1
        } else {
            print("No")
        }
    }
    case "c": do {
        print("No")
    }
    default:
        assert(false)
    }
}


print(A, B, S)
//  [swift]
import Foundation

let S = readLine()!
let NAB = S.components(separatedBy: " ")

print(NAB)
//  [swift]
let input = readLine()!.characters.split(" ").map{Int(String($0))!}
var A = input[1]
var B = input[2]
for c in readLine()!.characters {
  if c=="a" && A+B>0 {
    print("Yes")
    A>0 ?(A--):(B--)
  } else if c=="b" && (B--)>0 {
    print("Yes")
  } else {
    print("No")
  }
}
//  [typescript]
import * as fs from "fs";

const [line1, line2, ..._] = fs.readFileSync("/dev/stdin", "utf8").split("\n");
const [N, A, B] = line1.split(" ").map(Number);

let passedInternational = 0, passed = 0;


for(let i=0; i<N; i++) {
	if (passed < A+B && line2[i] != 'c') {
		if (line2[i] == 'a') {
			passed += 1;
			console.log('Yes');
		} else if (line2[i] == 'b' && passedInternational < B) {
			passedInternational += 1;
			passed += 1;
			console.log('Yes');
		} else {
			console.log('No');
		}
	} else {
		console.log('No');
	}
}
//  [typescript]
import { isRegExp } from "util";

class AtCoder {
  // 入力系
  input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);
  input_i=-1;

  n(){
    this.input_i++;
    return Number(this.input[this.input_i]);
  }
  nn(n:number):number[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.n());
    }
    return a;
  }
  s(){
    this.input_i++;
    return String(this.input[this.input_i]);
  }
  ss(n:number):string[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.s());
    }
    return a;
  }

  // コンソール
  o(...a:any){
    console.log(...a);
  }

  // Math
  abs(a:number){
    return Math.abs(a);
  }
  min(...a:number[]){
    return Math.min(...a);
  }
  max(...a:number[]){
    return Math.max(...a);
  }
  floor(a:number){
    return Math.floor(a);
  }
  ceil(a:number){
    return Math.ceil(a);
  }
  round(a:number){
    return Math.round(a);
  }

  // ソート
  asc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return a-b});
  }
  desc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return b-a});
  }

  // 自作
  gcd(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=x;
    }
    return arr[arr.length-1];
  };
  lcm(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=arr[i]*arr[i+1]/x;
    }
    return arr[arr.length-1];
  };
  isPrime(n:number):boolean{
    if(n < 2) return false;
    const suq=Math.sqrt(n);
    for(let i=2;i<=suq;i++){
      if(n%i==0){
        return false;
      }
    }return true;
  };
  deduplicate(a:any[]):any[]{
    return Array.from(new Set(a));
  };
  f(roop:number, callback:any){
    for(let i=0;i<roop;i++){
      callback(i);
    }
  };
  Yes(){
    console.log('Yes');
  }
  No(){
    console.log('No');
  }
  YES(){
    console.log('YES');
  }
  NO(){
    console.log('NO');
  }
}
const m = () => {
  const o = new AtCoder();
  let [n,a,b]=o.nn(3)
  let s=o.s()
  let pass=0
  let kpass=0
  for(let i=0;i<n;i++){
    if(s[i] == 'a' && pass < (a+b)){
      o.Yes()
      pass++
    }else if(s[i] == 'b' && (kpass) < b){
      o.Yes()
      kpass++
      pass++
    }else{
      o.No()
    }
  }
}
m();
//  [python]
a,b = map(int,input().split())

if a <= 0 and b >= 0:
    print("Zero")
    exit()

if a > 0:
    print("Positive")
    exit()
    
res = min(0,b) - min(0,a) + 1

if res%2 == 0:
    print("Positive")
else:
    print("Negative")
//  [python]
a, b = map(int, input().split())
if b < 0:
    print("Positive" if (b - a + 1) % 2 == 0 else "Negative")
elif a <= 0 and b >= 0:
    print("Zero")
else:
    print("Positive")
//  [python]
a,b=map(int,input().split())
K=1
if a>0:
    print('Positive')
elif a<=0 and b>=0:
    print('Zero')
elif (b-a)%2==0:
    print('Negative')
else:
    print('Positive')
//  [python]
a,b = map(int,input().split())

if a <= 0 <= b:
    print("zero")
elif a <= b < 0 and (b-a) % 2 == 0:
    print("Negative")
else:
    print("Positive")
//  [python]
a,b = map(int,input().split())

if 0 < a <= b:
    print("Positive")
elif a <= b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("zero")
//  [python]
a,b = map(int,input().split())

count = 1

for i in range(a,b+1):
    count *= i

if count == 0:
    print("Zero")
elif count > 0:
    print("Positive")
else:
    print("Negative")
//  [java]
import java.io.*;

public class Main {
    
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] in1 = br.readLine().split(" ");
        int a = Integer.parseInt(in1[0]);
        int b = Integer.parseInt(in1[1]);
        br.close();

        if(a <= 0 && b >= 0){
            System.out.println("Zero");
        }else if(a > 0){
            System.out.println("Positive");
        }else if((b - a) % 2 == 1){
            System.out.println("Positive");
        }else{
            System.out.println("Negative");
        }
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		StringTokenizer st;
		int a,b;
		for (String line; (line = in.readLine())!=null;) {
			st = new StringTokenizer(line);

			a = Integer.parseInt(st.nextToken());
			b = Integer.parseInt(st.nextToken());

			if((a<0&&b>0)||(a==0||b==0)){
				out.println("Zero");
			}else if((a>0&&b>0)||(Math.abs(Math.abs(b)+Math.abs(a))%2!=0)){
				out.println("Positive");
			}else{
				out.println("Negative");
			}

		}

		out.close();
		in.close();
	}
}